View | Details | Raw Unified | Return to issue 63614
Collapse All | Expand All

(-)basic/inc/basic/sbxmeth.hxx (-3 / +8 lines)
Lines 31-47 Link Here
31
class SbxMethod : public SbxVariable
31
class SbxMethod : public SbxVariable
32
{
32
{
33
	SbxMethodImpl* mpSbxMethodImpl;	// Impl data
33
	SbxMethodImpl* mpSbxMethodImpl;	// Impl data
34
	bool           mbIsRuntimeFunction;
35
	SbxDataType    mbRuntimeFunctionReturnType;
34
36
35
public:
37
public:
36
	SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1);
38
	SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1);
37
	TYPEINFO();
39
	TYPEINFO();
38
	SbxMethod( const String& r, SbxDataType t )
40
	SbxMethod( const String& r, SbxDataType t, bool bIsRuntimeFunction=false )
39
	: SbxVariable( t ) { SetName( r ); }
41
	: SbxVariable( t ), mbIsRuntimeFunction( bIsRuntimeFunction ), mbRuntimeFunctionReturnType( t ) { SetName( r ); }
40
	SbxMethod( const SbxMethod& r ) : SvRefBase( r ), SbxVariable( r ) {}
42
	SbxMethod( const SbxMethod& r )
43
	: SvRefBase( r ), SbxVariable( r ), mbIsRuntimeFunction( r.IsRuntimeFunction() ) {}
41
	SbxMethod& operator=( const SbxMethod& r )
44
	SbxMethod& operator=( const SbxMethod& r )
42
	{ SbxVariable::operator=( r ); return *this; }
45
	{ SbxVariable::operator=( r ); return *this; }
43
	sal_Bool Run( SbxValues* pValues = NULL );
46
	sal_Bool Run( SbxValues* pValues = NULL );
44
	virtual SbxClassType GetClass() const;
47
	virtual SbxClassType GetClass() const;
48
	bool IsRuntimeFunction() const { return mbIsRuntimeFunction; }
49
	SbxDataType GetRuntimeFunctionReturnType() const{ return mbRuntimeFunctionReturnType; }
45
};
50
};
46
51
47
#ifndef __SBX_SBXMETHODREF_HXX
52
#ifndef __SBX_SBXMETHODREF_HXX
(-)basic/inc/basic/sbxobj.hxx (-1 / +1 lines)
Lines 80-86 Link Here
80
	SbxVariable* Execute( const String& );
80
	SbxVariable* Execute( const String& );
81
	// Manage elements
81
	// Manage elements
82
	virtual sal_Bool GetAll( SbxClassType ) { return sal_True; }
82
	virtual sal_Bool GetAll( SbxClassType ) { return sal_True; }
83
	SbxVariable* Make( const String&, SbxClassType, SbxDataType );
83
	SbxVariable* Make( const String&, SbxClassType, SbxDataType, bool bIsRuntimeFunction = false );
84
	virtual SbxObject* MakeObject( const String&, const String& );
84
	virtual SbxObject* MakeObject( const String&, const String& );
85
	virtual void Insert( SbxVariable* );
85
	virtual void Insert( SbxVariable* );
86
	// AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and 
86
	// AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and 
(-)basic/source/comp/parser.cxx (-1 / +9 lines)
Lines 169-175 Link Here
169
		if( pVar->IsA( TYPE(SbxMethod) ) )
169
		if( pVar->IsA( TYPE(SbxMethod) ) )
170
		{
170
		{
171
			SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym );
171
			SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym );
172
			pProc_->SetType( pVar->GetType() );
172
			SbxMethod* pMethod = (SbxMethod*) pVar;
173
			if ( pMethod && pMethod->IsRuntimeFunction() )
174
			{
175
				pProc_->SetType( pMethod->GetRuntimeFunctionReturnType() );
176
			}
177
			else
178
			{
179
				pProc_->SetType( pVar->GetType() );
180
			}
173
			pDef = pProc_;
181
			pDef = pProc_;
174
		}
182
		}
175
		else
183
		else
(-)basic/source/runtime/stdobj.cxx (-1 / +1 lines)
Lines 715-721 Link Here
715
				eCT = SbxCLASS_PROPERTY;
715
				eCT = SbxCLASS_PROPERTY;
716
			else if( nType & _METHOD )
716
			else if( nType & _METHOD )
717
				eCT = SbxCLASS_METHOD;
717
				eCT = SbxCLASS_METHOD;
718
			pVar = Make( aName_, eCT, p->eType );
718
			pVar = Make( aName_, eCT, p->eType, ( p->nArgs & _FUNCTION ) == _FUNCTION );
719
			pVar->SetUserData( nIndex + 1 );
719
			pVar->SetUserData( nIndex + 1 );
720
			pVar->SetFlags( nAccess );
720
			pVar->SetFlags( nAccess );
721
		}
721
		}
(-)basic/source/sbx/sbxobj.cxx (-2 / +2 lines)
Lines 376-382 Link Here
376
// Falls ein neues Objekt eingerichtet wird, wird es, falls es bereits
376
// Falls ein neues Objekt eingerichtet wird, wird es, falls es bereits
377
// eines mit diesem Namen gibt, indiziert.
377
// eines mit diesem Namen gibt, indiziert.
378
378
379
SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt )
379
SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt, bool bIsRuntimeFunction )
380
{
380
{
381
	// Ist das Objekt bereits vorhanden?
381
	// Ist das Objekt bereits vorhanden?
382
	SbxArray* pArray = NULL;
382
	SbxArray* pArray = NULL;
Lines 422-428 Link Here
422
			pVar = new SbxProperty( rName, dt );
422
			pVar = new SbxProperty( rName, dt );
423
			break;
423
			break;
424
		case SbxCLASS_METHOD:
424
		case SbxCLASS_METHOD:
425
			pVar = new SbxMethod( rName, dt );
425
			pVar = new SbxMethod( rName, dt, bIsRuntimeFunction );
426
			break;
426
			break;
427
		case SbxCLASS_OBJECT:
427
		case SbxCLASS_OBJECT:
428
			pVar = CreateObject( rName );
428
			pVar = CreateObject( rName );

Return to issue 63614