summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox/workbookfragment.cxx
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-06-20 18:47:22 +0100
committerNoel Power <noel.power@novell.com>2012-06-20 21:01:13 +0100
commit7fff98724bc7e3f4d3defb005aa1358d743d08ed (patch)
tree2d1a257107b3f560cc06035dc1cef8c1c19fd37c /sc/source/filter/oox/workbookfragment.cxx
parent0e73f3cbe116ac949264482525167eb750835da9 (diff)
big formula performance improvement for xlsx import (bnc#763168 & bnc#765942)
we get a large performance win by evaluating the formulas at the end of import where we can set up the ScAutoNameCache cache. Change-Id: Id3763afb805eb9bfa9a6a55e1de3923f02e621ae
Diffstat (limited to 'sc/source/filter/oox/workbookfragment.cxx')
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 2ef185d0f921..843a7feadd4e 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -222,6 +222,7 @@ void WorkbookFragment::finalizeImport()
importOoxFragment( new ConnectionsFragment( *this, aConnFragmentPath ) );
xGlobalSegment->setPosition( 1.0 );
+
/* Create fragments for all sheets, before importing them. Needed to do
some preprocessing in the fragment constructors, e.g. loading the table
fragments for all sheets that are needed before the cell formulas are
@@ -243,7 +244,9 @@ void WorkbookFragment::finalizeImport()
OSL_ENSURE( !aFragmentPath.isEmpty(), "WorkbookFragment::finalizeImport - cannot access sheet fragment" );
if( !aFragmentPath.isEmpty() )
{
- double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - nWorksheet);
+ // leave space for formula processing ( calcuate the segments as
+ // if there is an extra sheet )
+ double fSegmentLength = getProgressBar().getFreeLength() / (nWorksheetCount - ( nWorksheet - 1) );
ISegmentProgressBarRef xSheetSegment = getProgressBar().createSegment( fSegmentLength );
// get the sheet type according to the relations type
@@ -293,7 +296,7 @@ void WorkbookFragment::finalizeImport()
// create all defined names and database ranges
getDefinedNames().finalizeImport();
getTables().finalizeImport();
-
+ int nSheetNum = 0;
// load all worksheets
for( SheetFragmentVector::iterator aIt = aSheetFragments.begin(), aEnd = aSheetFragments.end(); aIt != aEnd; ++aIt )
{