summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-07-27 11:53:35 +0200
committerDaniel Rentz <dr@openoffice.org>2010-07-27 11:53:35 +0200
commit1e940446fbe06455d6c947bf62510c015d8bd1e2 (patch)
treeb9f71d6c2c6dacde7928c2cf9593f72b2c0173c4 /oox
parent366a18ae5698f759c3f463294d69abee41d1f8a3 (diff)
mib17: #i112634# prepare loading VBA with document events from ODF and XLSM
Diffstat (limited to 'oox')
-rwxr-xr-xoox/source/ole/vbaproject.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 04f3eb49d35d..638039a3d79a 100755
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -362,7 +362,8 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
specified. */
if( !aModules.empty() ) try
{
- // get the basic library
+ // get the model factory and the basic library
+ Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW );
Reference< XNameContainer > xBasicLib( createBasicLibrary(), UNO_SET_THROW );
// set library container to VBA compatibility mode
@@ -374,11 +375,19 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
{
}
+ // create the VBAGlobals object, the model will store it in the Basic manager
+ try
+ {
+ xModelFactory->createInstance( CREATE_OUSTRING( "ooo.vba.VBAGlobals" ) );
+ }
+ catch( Exception& )
+ {
+ }
+
// try to get access to document objects related to code modules
Reference< XNameAccess > xDocObjectNA;
try
{
- Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW );
xDocObjectNA.set( xModelFactory->createInstance( CREATE_OUSTRING( "ooo.vba.VBAObjectModuleObjectProvider" ) ), UNO_QUERY );
}
catch( Exception& )