diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-19 18:04:26 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-24 16:51:37 -0400 |
commit | 57538e5f5002ecc2df95087244cb0431867c443e (patch) | |
tree | 3840997c086d1a735ce25321a808ef7486fedf7f /sc | |
parent | Fix the horizontal cell iterator. (diff) | |
download | core-57538e5f5002ecc2df95087244cb0431867c443e.tar.gz core-57538e5f5002ecc2df95087244cb0431867c443e.zip |
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
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/column.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index a239a0fbd2f9..a62b05ce1157 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(); } |