summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-25 16:38:52 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-25 16:40:43 -0400
commit5e83804da815a982aed567a8cae4cc078491dcbd (patch)
treed29f5087f8d1eb9952a9ea140fae018b9adfb9c7 /sc
parent671566d0612a26c844501f0cf042138b5fe5c040 (diff)
bnc#882595: Process VBA blobs before formula cells.
So that formula cells with user-defined functions will be interpreted correctly. Change-Id: I49c10109575f9f82d7f85dea63590bf02b70e041
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index d7c6443e1e2a..3ebf7024802b 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -747,6 +747,13 @@ void WorkbookHelper::finalizeWorkbookImport()
mrBookGlob.getWorkbookSettings().finalizeImport();
mrBookGlob.getViewSettings().finalizeImport();
+ // Import the VBA project (after finalizing workbook settings which
+ // contains the workbook code name). Do it before processing formulas in
+ // order to correctly resolve VBA custom function names.
+ StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage();
+ if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
+ getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
+
// need to import formulas before scenarios
mrBookGlob.getFormulaBuffer().finalizeImport();
@@ -766,12 +773,6 @@ void WorkbookHelper::finalizeWorkbookImport()
sheets. Automatic numbering is set by passing the value 0. */
PropertySet aDefPageStyle( getStyleObject( "Default", true ) );
aDefPageStyle.setProperty< sal_Int16 >( PROP_FirstPageNumber, 0 );
-
- /* Import the VBA project (after finalizing workbook settings which
- contains the workbook code name). */
- StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage();
- if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
- getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
}
// document model -------------------------------------------------------------