summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-20 11:31:42 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-20 11:34:26 -0500
commit49a3f0c43e8f0ad236445a374b9524634645f824 (patch)
treefdb9449380d390e3b3aa828e65a09aa350ac8933 /sc/source
parentc3a9a9542b018f781ee12e6c8c943d4f19641afe (diff)
No need to start listening in CalcAfterLoad for xls import.
We do that prior to it, and in fact, doing it here would unregister all group area listeners and re-register non-group ones, which is massively slower with huge documents. Change-Id: I693f681df05f036eb1aa53554e601066c469f49a
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column.cxx11
-rw-r--r--sc/source/core/data/document.cxx4
-rw-r--r--sc/source/core/data/formulacell.cxx6
-rw-r--r--sc/source/core/data/table2.cxx4
-rw-r--r--sc/source/filter/excel/read.cxx4
5 files changed, 17 insertions, 12 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index f3821966ea28..c0e2991912c3 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2824,12 +2824,15 @@ public:
class CalcAfterLoadHandler
{
sc::CompileFormulaContext& mrCxt;
+ bool mbStartListening;
+
public:
- CalcAfterLoadHandler( sc::CompileFormulaContext& rCxt ) : mrCxt(rCxt) {}
+ CalcAfterLoadHandler( sc::CompileFormulaContext& rCxt, bool bStartListening ) :
+ mrCxt(rCxt), mbStartListening(bStartListening) {}
void operator() (size_t /*nRow*/, ScFormulaCell* pCell)
{
- pCell->CalcAfterLoad(mrCxt);
+ pCell->CalcAfterLoad(mrCxt, mbStartListening);
}
};
@@ -3257,9 +3260,9 @@ bool ScColumn::CompileErrorCells( sc::CompileFormulaContext& rCxt, sal_uInt16 nE
return aHdl.isCompiled();
}
-void ScColumn::CalcAfterLoad( sc::CompileFormulaContext& rCxt )
+void ScColumn::CalcAfterLoad( sc::CompileFormulaContext& rCxt, bool bStartListening )
{
- CalcAfterLoadHandler aFunc(rCxt);
+ CalcAfterLoadHandler aFunc(rCxt, bStartListening);
sc::ProcessFormula(maCells, aFunc);
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index a8a370786c66..9f9e45ee41ee 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3740,7 +3740,7 @@ bool ScDocument::CompileErrorCells(sal_uInt16 nErrCode)
return bCompiled;
}
-void ScDocument::CalcAfterLoad()
+void ScDocument::CalcAfterLoad( bool bStartListening )
{
if (bIsClip) // Excel-Dateien werden aus dem Clipboard in ein Clip-Doc geladen
return; // dann wird erst beim Einfuegen in das richtige Doc berechnet
@@ -3751,7 +3751,7 @@ void ScDocument::CalcAfterLoad()
TableContainer::iterator it = maTabs.begin();
for (; it != maTabs.end(); ++it)
if (*it)
- (*it)->CalcAfterLoad(aCxt);
+ (*it)->CalcAfterLoad(aCxt, bStartListening);
for (it = maTabs.begin(); it != maTabs.end(); ++it)
if (*it)
(*it)->SetDirtyAfterLoad();
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 9fe02a20b8e5..dfeda726016f 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1283,7 +1283,7 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr
pDocument->PutInFormulaTree(this);
}
-void ScFormulaCell::CalcAfterLoad( sc::CompileFormulaContext& rCxt )
+void ScFormulaCell::CalcAfterLoad( sc::CompileFormulaContext& rCxt, bool bStartListening )
{
bool bNewCompiled = false;
// If a Calc 1.0-doc is read, we have a result, but no token array
@@ -1332,7 +1332,9 @@ void ScFormulaCell::CalcAfterLoad( sc::CompileFormulaContext& rCxt )
// the listener and Recalculate (if needed) if not RECALCMODE_NORMAL
if( !bNewCompiled || !pCode->GetCodeError() )
{
- StartListeningTo( pDocument );
+ if (bStartListening)
+ StartListeningTo(pDocument);
+
if( !pCode->IsRecalcModeNormal() )
bDirty = true;
}
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index ef81e6d35fd5..a787f6374bf4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1772,10 +1772,10 @@ bool ScTable::CompileErrorCells( sc::CompileFormulaContext& rCxt, sal_uInt16 nEr
return bCompiled;
}
-void ScTable::CalcAfterLoad( sc::CompileFormulaContext& rCxt )
+void ScTable::CalcAfterLoad( sc::CompileFormulaContext& rCxt, bool bStartListening )
{
for (SCCOL i = 0; i <= MAXCOL; ++i)
- aCol[i].CalcAfterLoad(rCxt);
+ aCol[i].CalcAfterLoad(rCxt, bStartListening);
}
void ScTable::ResetChanged( const ScRange& rRange )
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index 30d50453888e..777088bc593f 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -752,7 +752,7 @@ FltError ImportExcel::Read( void )
AdjustRowHeight();
PostDocLoad();
- pD->CalcAfterLoad();
+ pD->CalcAfterLoad(false);
const XclImpAddressConverter& rAddrConv = GetAddressConverter();
if( rAddrConv.IsTabTruncated() )
@@ -1291,7 +1291,7 @@ FltError ImportExcel8::Read( void )
#endif
PostDocLoad();
- pD->CalcAfterLoad();
+ pD->CalcAfterLoad(false);
// import change tracking data
XclImpChangeTrack aImpChTr( GetRoot(), maStrm );