summaryrefslogtreecommitdiff
path: root/filter
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 /filter
parent366a18ae5698f759c3f463294d69abee41d1f8a3 (diff)
mib17: #i112634# prepare loading VBA with document events from ODF and XLSM
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/svxmsbas.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/filter/source/msfilter/svxmsbas.cxx b/filter/source/msfilter/svxmsbas.cxx
index 49fd4a7544f3..baf63ef8e1ff 100644
--- a/filter/source/msfilter/svxmsbas.cxx
+++ b/filter/source/msfilter/svxmsbas.cxx
@@ -250,12 +250,20 @@ BOOL SvxImportMSVBasic::ImportCode_Impl( const String& rStorageName,
{
SFX_APP()->EnterBasicCall();
Reference<XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer();
- Reference<XVBACompat> xVBACompat( xLibContainer, UNO_QUERY );
+ DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
- if ( xVBACompat.is() && !bAsComment )
+ if( !bAsComment ) try
+ {
+ Reference< XVBACompat > xVBACompat( xLibContainer, UNO_QUERY_THROW );
xVBACompat->setVBACompatModeOn( sal_True );
-
- DBG_ASSERT( xLibContainer.is(), "No BasicContainer!" );
+ /* Force creation of the VBAGlobals object, each application will
+ create the right one and store it at the Basic manager. */
+ Reference< XMultiServiceFactory > xFactory( rDocSh.GetModel(), UNO_QUERY_THROW );
+ xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
+ }
+ catch( Exception& )
+ {
+ }
UINT16 nStreamCount = aVBA.GetNoStreams();
Reference<XNameContainer> xLib;