summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-06-25 12:29:46 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-06-27 15:47:54 -0400
commitb17237a7177e39f6611ccfc39e7758dd542f01e0 (patch)
treeb5ba0acfc194017cbc9dd353703cd6ed7b49061d /sc/source
parent18cd17813ebf19ac247d2d8003c3b96fb8582d28 (diff)
Replace ScCellIterator with sc::ProcessFormula.
Change-Id: I0adf57e5e80972175633dd0c69d465544aa7d7a9
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column3.cxx15
-rw-r--r--sc/source/core/data/document.cxx18
-rw-r--r--sc/source/core/data/table1.cxx6
3 files changed, 31 insertions, 8 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 4ec2bd873850..7251bbd7c0cc 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -115,6 +115,21 @@ void ScColumn::EndFormulaListening( sc::ColumnBlockPosition& rBlockPos, SCROW nR
sc::ProcessFormula(rBlockPos.miCellPos, maCells, nRow1, nRow2, aFunc);
}
+struct DirtyCellInterpreter
+{
+ void operator() (size_t, ScFormulaCell* p)
+ {
+ if (p->GetDirty())
+ p->Interpret();
+ }
+};
+
+void ScColumn::InterpretDirtyCells( SCROW nRow1, SCROW nRow2 )
+{
+ DirtyCellInterpreter aFunc;
+ sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aFunc);
+}
+
void ScColumn::Delete( SCROW nRow )
{
std::pair<sc::CellStoreType::iterator,size_t> aPos = maCells.position(nRow);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index f40e416a5ba6..3ed67c33b88c 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3482,20 +3482,22 @@ void ScDocument::SetTableOpDirty( const ScRange& rRange )
SetAutoCalc( bOldAutoCalc );
}
-
void ScDocument::InterpretDirtyCells( const ScRangeList& rRanges )
{
+ if (!GetAutoCalc())
+ return;
+
for (size_t nPos=0, nRangeCount = rRanges.size(); nPos < nRangeCount; nPos++)
{
- ScCellIterator aIter( this, *rRanges[ nPos ] );
- for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
+ const ScRange& rRange = *rRanges[nPos];
+ for (SCTAB nTab = rRange.aStart.Tab(); nTab <= rRange.aEnd.Tab(); ++nTab)
{
- if (aIter.getType() != CELLTYPE_FORMULA)
- continue;
+ ScTable* pTab = FetchTable(nTab);
+ if (!pTab)
+ return;
- ScFormulaCell* p = aIter.getFormulaCell();
- if (p->GetDirty() && GetAutoCalc())
- p->Interpret();
+ pTab->InterpretDirtyCells(
+ rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row());
}
}
}
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index d3d26a8396f0..2de23b1b9225 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2209,6 +2209,12 @@ void ScTable::FillMatrix( ScMatrix& rMat, SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
aCol[nCol].FillMatrix(rMat, nMatCol, nRow1, nRow2);
}
+void ScTable::InterpretDirtyCells( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
+{
+ for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+ aCol[nCol].InterpretDirtyCells(nRow1, nRow2);
+}
+
const SvtBroadcaster* ScTable::GetBroadcaster( SCCOL nCol, SCROW nRow ) const
{
if (!ValidColRow(nCol, nRow))