[Libreoffice-commits] .: basic/source
Noel Power
noelp at kemper.freedesktop.org
Wed Jul 4 03:50:34 PDT 2012
basic/source/classes/sbxmod.cxx | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
New commits:
commit 1f0abdcf60e30f6ce02fbed5a6918c7899a10f4e
Author: Daniel Rentz [dr] <daniel.rentz at oracle.com>
Date: Mon Mar 21 10:30:30 2011 +0100
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
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index e31ceeb..4097ea6 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
More information about the Libreoffice-commits
mailing list