--- basic/inc/basic/sbxmeth.hxx (revision 1634275) +++ basic/inc/basic/sbxmeth.hxx (working copy) @@ -31,17 +31,22 @@ class SbxMethod : public SbxVariable { SbxMethodImpl* mpSbxMethodImpl; // Impl data + bool mbIsRuntimeFunction; + SbxDataType mbRuntimeFunctionReturnType; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1); TYPEINFO(); - SbxMethod( const String& r, SbxDataType t ) - : SbxVariable( t ) { SetName( r ); } - SbxMethod( const SbxMethod& r ) : SvRefBase( r ), SbxVariable( r ) {} + SbxMethod( const String& r, SbxDataType t, bool bIsRuntimeFunction=false ) + : SbxVariable( t ), mbIsRuntimeFunction( bIsRuntimeFunction ), mbRuntimeFunctionReturnType( t ) { SetName( r ); } + SbxMethod( const SbxMethod& r ) + : SvRefBase( r ), SbxVariable( r ), mbIsRuntimeFunction( r.IsRuntimeFunction() ) {} SbxMethod& operator=( const SbxMethod& r ) { SbxVariable::operator=( r ); return *this; } sal_Bool Run( SbxValues* pValues = NULL ); virtual SbxClassType GetClass() const; + bool IsRuntimeFunction() const { return mbIsRuntimeFunction; } + SbxDataType GetRuntimeFunctionReturnType() const{ return mbRuntimeFunctionReturnType; } }; #ifndef __SBX_SBXMETHODREF_HXX --- basic/inc/basic/sbxobj.hxx (revision 1634275) +++ basic/inc/basic/sbxobj.hxx (working copy) @@ -80,7 +80,7 @@ SbxVariable* Execute( const String& ); // Manage elements virtual sal_Bool GetAll( SbxClassType ) { return sal_True; } - SbxVariable* Make( const String&, SbxClassType, SbxDataType ); + SbxVariable* Make( const String&, SbxClassType, SbxDataType, bool bIsRuntimeFunction = false ); virtual SbxObject* MakeObject( const String&, const String& ); virtual void Insert( SbxVariable* ); // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and --- basic/source/comp/parser.cxx (revision 1634275) +++ basic/source/comp/parser.cxx (working copy) @@ -169,7 +169,15 @@ if( pVar->IsA( TYPE(SbxMethod) ) ) { SbiProcDef* pProc_ = aRtlSyms.AddProc( rSym ); - pProc_->SetType( pVar->GetType() ); + SbxMethod* pMethod = (SbxMethod*) pVar; + if ( pMethod && pMethod->IsRuntimeFunction() ) + { + pProc_->SetType( pMethod->GetRuntimeFunctionReturnType() ); + } + else + { + pProc_->SetType( pVar->GetType() ); + } pDef = pProc_; } else --- basic/source/runtime/stdobj.cxx (revision 1634275) +++ basic/source/runtime/stdobj.cxx (working copy) @@ -715,7 +715,7 @@ eCT = SbxCLASS_PROPERTY; else if( nType & _METHOD ) eCT = SbxCLASS_METHOD; - pVar = Make( aName_, eCT, p->eType ); + pVar = Make( aName_, eCT, p->eType, ( p->nArgs & _FUNCTION ) == _FUNCTION ); pVar->SetUserData( nIndex + 1 ); pVar->SetFlags( nAccess ); } --- basic/source/sbx/sbxobj.cxx (revision 1634275) +++ basic/source/sbx/sbxobj.cxx (working copy) @@ -376,7 +376,7 @@ // Falls ein neues Objekt eingerichtet wird, wird es, falls es bereits // eines mit diesem Namen gibt, indiziert. -SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt ) +SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt, bool bIsRuntimeFunction ) { // Ist das Objekt bereits vorhanden? SbxArray* pArray = NULL; @@ -422,7 +422,7 @@ pVar = new SbxProperty( rName, dt ); break; case SbxCLASS_METHOD: - pVar = new SbxMethod( rName, dt ); + pVar = new SbxMethod( rName, dt, bIsRuntimeFunction ); break; case SbxCLASS_OBJECT: pVar = CreateObject( rName );