diff options
author | npower Developer <npower@openoffice.org> | 2010-02-26 18:29:25 +0000 |
---|---|---|
committer | npower Developer <npower@openoffice.org> | 2010-02-26 18:29:25 +0000 |
commit | 1c87beca79bc52e9d3aa97bf05f409c5906723cc (patch) | |
tree | ea28e9b8f3aca8f179851bc7ed93d03956e42700 /basic/source | |
parent | 06a855ff63da3f91d954264181182f5ffff5e385 (diff) |
npower14miscfixes: #i109644# don't load vba stuff for odf document ( untill you go into vbamode in basic )
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/classes/sb.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index c5ac53c43092..3d35f70d2b38 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -54,6 +54,7 @@ #include "sb.hrc" #include <basrid.hxx> #include <vos/mutex.hxx> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> // #pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE ) @@ -63,14 +64,27 @@ TYPEINIT1(StarBASIC,SbxObject) #define RTLNAME "@SBRTL" // i#i68894# - +using com::sun::star::uno::Reference; +using com::sun::star::uno::Any; +using com::sun::star::uno::UNO_QUERY; +using com::sun::star::lang::XMultiServiceFactory; +; const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); SbxObject* StarBASIC::getVBAGlobals( ) { if ( !pVBAGlobals ) + { + Any aThisDoc; + if ( GetUNOConstant("ThisComponent", aThisDoc) ) + { + Reference< XMultiServiceFactory > xDocFac( aThisDoc, UNO_QUERY ); + if ( xDocFac.is() ) + xDocFac->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) ); + } pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE ); + } return pVBAGlobals; } |