summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-12-18 14:33:20 +0000
committerNoel Power <noel.power@suse.com>2012-12-18 14:37:11 +0000
commit015bcb0840a584a660cefec412493107b74f4712 (patch)
tree4f5768c747bd3d1576710ca01610e3a7cb7831d2
parentdecf6bf7207ae36bc5882f2e945a7d3f8587cf03 (diff)
finalize pivot *before* scenario sheet to ensure table numbers are correct
Change-Id: I15cf378b51b1ecfbd05c7013e5a5b69fb87fdafb
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index e5521e77db77..c3c2fbb2c3ee 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -597,11 +597,6 @@ void WorkbookGlobals::finalize()
// #i79826# enable updating automatic row height after loading the document
aPropSet.setProperty( PROP_IsAdjustHeightEnabled, true );
- // Insert all pivot tables. Must be done after loading all sheets and
- // formulas, because data pilots expect existing source data on
- // creation.
- getPivotTables().finalizeImport();
-
// #i76026# enable Undo after loading the document
aPropSet.setProperty( PROP_IsUndoEnabled, true );
// disable editing read-only documents (e.g. from read-only files)
@@ -674,6 +669,12 @@ void WorkbookHelper::finalizeWorkbookImport()
// need to import formulas before scenarios
mrBookGlob.getFormulaBuffer().finalizeImport();
+
+ // Insert all pivot tables. Must be done after loading all sheets and
+ // formulas, because data pilots expect existing source data on
+ // creation.
+ getPivotTables().finalizeImport();
+
/* Insert scenarios after all sheet processing is done, because new hidden
sheets are created for scenarios which would confuse code that relies
on certain sheet indexes. Must be done after pivot tables too. */