summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2011-04-13 18:46:02 +0200
committerKurt Zenker <kz@openoffice.org>2011-04-13 18:46:02 +0200
commit80283e1fb7c6d47afb385339dbae708805d74ca0 (patch)
treefeca37d84552b43c8f89f8fde2a5bdb824ebd1dc /basic
parent8a1c747c8d8b521c2f3240f12dd109be26078764 (diff)
parentcba7675b90c924eb10ba78ff3f8613669bca5d6f (diff)
CWS-TOOLING: integrate CWS dr80_OOO340
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 24b031e8f4e9..a9e378d69d9d 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1017,8 +1017,22 @@ sal_Bool SbModule::IsVBACompat() const
void SbModule::SetVBACompat( sal_Bool bCompat )
{
- mbVBACompat = bCompat;
+ if( mbVBACompat != bCompat )
+ {
+ mbVBACompat = bCompat;
+ // initialize VBA document API
+ if( mbVBACompat ) try
+ {
+ StarBASIC* pBasic = static_cast< StarBASIC* >( GetParent() );
+ uno::Reference< lang::XMultiServiceFactory > xFactory( getDocumentModel( pBasic ), uno::UNO_QUERY_THROW );
+ xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
+ }
+ catch( Exception& )
+ {
+ }
+ }
}
+
// Ausfuehren eines BASIC-Unterprogramms
sal_uInt16 SbModule::Run( SbMethod* pMeth )
{