[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Wed Jun 19 17:03:20 PDT 2013
sc/source/core/data/column.cxx | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
New commits:
commit b8f1fb252d45a7b97390264d4f3536562d868017
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed Jun 19 18:04:26 2013 -0400
Update references on all cells.
Passed row range is the range of moved cells, not the range of cells
to update.
This alone fixes 3 unit tests.
Change-Id: I4cb154879c6c33bc277bc2ab136f7580c35e479e
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index a239a0f..a62b05c 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2055,20 +2055,33 @@ public:
}
};
-class UpdateRefOnNonCopy : public UpdateRefHandler
+class UpdateRefOnNonCopy
{
SCCOL mnCol;
SCROW mnTab;
+ ScRange maRange;
+ SCCOL mnDx;
+ SCROW mnDy;
+ SCTAB mnDz;
+ UpdateRefMode meMode;
+ ScDocument* mpUndoDoc;
+ bool mbUpdated;
+
public:
- UpdateRefOnNonCopy(SCCOL nCol, SCTAB nTab, const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz, UpdateRefMode eMode, ScDocument* pUndoDoc) :
- UpdateRefHandler(rRange, nDx, nDy, nDz, eMode, pUndoDoc),
- mnCol(nCol), mnTab(nTab) {}
+ UpdateRefOnNonCopy(
+ SCCOL nCol, SCTAB nTab, const ScRange& rRange,
+ SCCOL nDx, SCROW nDy, SCTAB nDz, UpdateRefMode eMode,
+ ScDocument* pUndoDoc) :
+ mnCol(nCol), mnTab(nTab), maRange(rRange),
+ mnDx(nDx), mnDy(nDy), mnDz(nDz), meMode(eMode), mpUndoDoc(pUndoDoc), mbUpdated(false) {}
- virtual void updateReference(ScFormulaCell& rCell, SCROW nRow)
+ void operator() (size_t nRow, ScFormulaCell* pCell)
{
ScAddress aUndoPos(mnCol, nRow, mnTab);
- mbUpdated |= rCell.UpdateReference(meMode, maRange, mnDx, mnDy, mnDz, mpUndoDoc, &aUndoPos);
+ mbUpdated |= pCell->UpdateReference(meMode, maRange, mnDx, mnDy, mnDz, mpUndoDoc, &aUndoPos);
}
+
+ bool isUpdated() const { return mbUpdated; }
};
}
@@ -2087,7 +2100,7 @@ bool ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
}
UpdateRefOnNonCopy aHandler(nCol, nTab, aRange, nDx, nDy, nDz, eUpdateRefMode, pUndoDoc);
- sc::ProcessBlock(maCells.begin(), maCells, aHandler, nRow1, nRow2);
+ sc::ProcessFormula(maCells, aHandler);
return aHandler.isUpdated();
}
More information about the Libreoffice-commits
mailing list