summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-03-21 10:30:30 +0100
committerNoel Power <noel.power@novell.com>2012-07-04 11:50:22 +0100
commit1f0abdcf60e30f6ce02fbed5a6918c7899a10f4e (patch)
tree68e3c98913def60aeb05e5021ef02aa286488c72 /basic
parent30d3637516e9d22d237fb0bd4d71e12eebb16615 (diff)
dr80: #i117392# initialize VBAGlobals object if single Basic module is in VBA mode, do not expect existing parent sheet in implementation of Excel.Application.ActiveCell
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index e31ceeb59d3f..4097ea6ab630 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1085,7 +1085,20 @@ bool SbModule::IsVBACompat() const
void SbModule::SetVBACompat( 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& )
+ {
+ }
+ }
}
// Run a Basic-subprogram