summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorDaniel Bankston <daniel.e.bankston@gmail.com>2012-07-28 03:24:57 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-08-24 11:55:44 -0400
commitdeaac6fffa883d5604a35eb0706c7526b87398cc (patch)
treea7a5d089c2c9d00449ddcc9ea2e3df6920df5e59 /sc/inc
parent1b40fbe41459a2231870af94a06263d89af554a6 (diff)
Improve matrix import performance.
Our latest changes that recalculate volatile formulas at the end of import resulted in several seconds performance loss on a large matrix test file with complex formulas. When the matrix cells are put in the document, ScFormulaCell::SetDirty() gets called. Although the cells are set clean during import after this, SetDirty() also uses ScDocument::TrackFormulas() which puts the cells in the formula tree. So when we call ScDocument::DoRecalc() at the end of import, the interpreter goes through all matrix cells because they are in the formula tree. This commit prevent that from happening, which gives us back our performance. Change-Id: I961f69b0117d4261f8afefb6d94173105f0925b2
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/cell.hxx4
-rw-r--r--sc/inc/document.hxx6
2 files changed, 6 insertions, 4 deletions
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index f609a4642109..79e99dba8527 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -376,7 +376,7 @@ public:
void GetFormula( rtl::OUStringBuffer& rBuffer,
const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const;
- void SetDirty();
+ void SetDirty( bool bDirtyFlag=true );
void SetDirtyVar();
// If setting entire document dirty after load, no broadcasts but still append to FormulaTree.
void SetDirtyAfterLoad();
@@ -472,7 +472,7 @@ public:
virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint);
void SetCompile( bool bVal ) { bCompile = bVal; }
ScDocument* GetDocument() const { return pDocument; }
- void SetMatColsRows( SCCOL nCols, SCROW nRows );
+ void SetMatColsRows( SCCOL nCols, SCROW nRows, bool bDirtyFlag=true );
void GetMatColsRows( SCCOL& nCols, SCROW& nRows ) const;
// cell belongs to ChangeTrack and not to the real document
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index ba23156effac..a2db35f8388c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -770,7 +770,8 @@ public:
const ScMarkData& rMark,
const rtl::OUString& rFormula,
const ScTokenArray* p = NULL,
- const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT );
+ const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT,
+ bool bDirtyFlag=true );
SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam& rParam, // multi-operation
SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark);
@@ -1657,7 +1658,8 @@ public:
void PutInFormulaTree( ScFormulaCell* pCell );
void RemoveFromFormulaTree( ScFormulaCell* pCell );
void CalcFormulaTree( bool bOnlyForced = false,
- bool bNoProgressBar = false );
+ bool bNoProgressBar = false,
+ bool bDirtyFlag=true );
void ClearFormulaTree();
void AppendToFormulaTrack( ScFormulaCell* pCell );
void RemoveFromFormulaTrack( ScFormulaCell* pCell );