diff options
author | Noel Power <noel.power@suse.com> | 2013-06-04 15:24:29 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-04 15:29:45 +0100 |
commit | 25bb9d13b259dbfb73f1412506f0d051b3670089 (patch) | |
tree | c560d5d66e20b8f473eafbc54be374375d4a1489 /sc/source/filter | |
parent | 78775f1ad9b3f394896179898db984e139d5b5cc (diff) |
fix for fdo#53042 fix ole object macro bindings ( for xlsm )
A number of fixes needed here
a) make sure convert properties of control model is done before inserting
control model into formcontainer, need to do that to ensure that
GenerateVBAEvents is set ( so the fake VBA event generation can be
triggered )
b) remove the IsAlieanExcel check in servuno.cxx ( it's too strict and
additionally seems there is confusion over the media type to check )
c) split the vba import so that we can ensure the VBA mode is set (if
we have modules to import ) before sheets are imported and defer further
processing ( actual assigning of the modules and associated objects )
until later
Change-Id: I8fdbe788b400d7e41d4cc4b51b15f692bd7b0ecc
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/oox/workbookfragment.cxx | 23 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 2 |
2 files changed, 15 insertions, 10 deletions
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 5fad0fd6af25..6907d93d4b50 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -51,6 +51,7 @@ #include <comphelper/processfactory.hxx> #include <officecfg/Office/Calc.hxx> +#include "oox/ole/vbaproject.hxx" namespace oox { namespace xls { @@ -299,6 +300,19 @@ void WorkbookFragment::finalizeImport() // create all defined names and database ranges getDefinedNames().finalizeImport(); getTables().finalizeImport(); + // open the VBA project storage + OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) ); + if( !aVbaFragmentPath.isEmpty() ) + { + Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath ); + if( xInStrm.is() ) + { + StorageRef xPrjStrg( new ::oox::ole::OleStorage( getBaseFilter().getComponentContext(), xInStrm, false ) ); + setVbaProjectStorage( xPrjStrg ); + getBaseFilter().getVbaProject().readVbaModules( *xPrjStrg ); + } + } + // load all worksheets for( SheetFragmentVector::iterator aIt = aSheetFragments.begin(), aEnd = aSheetFragments.end(); aIt != aEnd; ++aIt ) { @@ -318,15 +332,6 @@ void WorkbookFragment::finalizeImport() aIt->first.reset(); } - // open the VBA project storage - OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) ); - if( !aVbaFragmentPath.isEmpty() ) - { - Reference< XInputStream > xInStrm = getBaseFilter().openInputStream( aVbaFragmentPath ); - if( xInStrm.is() ) - setVbaProjectStorage( StorageRef( new ::oox::ole::OleStorage( getBaseFilter().getComponentContext(), xInStrm, false ) ) ); - } - // final conversions, e.g. calculation settings and view settings finalizeWorkbookImport(); diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 51fd4266aafc..5e9b39f16d1c 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -710,7 +710,7 @@ void WorkbookHelper::finalizeWorkbookImport() contains the workbook code name). */ StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage(); if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() ) - getBaseFilter().getVbaProject().importVbaProject( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); + getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); } // document model ------------------------------------------------------------- |