diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-25 21:01:37 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-27 15:47:55 -0400 |
commit | 7c309d8e479e993bce0a04348ab24dca7b7e1ab0 (patch) | |
tree | 6d6b58eb2af76fef38bd109df5722793b793b8eb | |
parent | 21a04e7ba394da27907d1be12b9fc43414db580e (diff) |
Remove this inheritance.
Change-Id: I37e0a6b8e95f56210df823af7aa8828189edfbef
-rw-r--r-- | sc/source/core/data/column.cxx | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index c538d24738aa..a3f80bbd3ca2 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2002,22 +2002,19 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) namespace { -class UpdateRefHandler +class UpdateRefOnCopy { protected: ScRange maRange; SCCOL mnDx; SCROW mnDy; SCTAB mnDz; - UpdateRefMode meMode; ScDocument* mpUndoDoc; bool mbUpdated; public: - UpdateRefHandler(const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz, UpdateRefMode eMode, ScDocument* pUndoDoc) : - maRange(rRange), mnDx(nDx), mnDy(nDy), mnDz(nDz), meMode(eMode), mpUndoDoc(pUndoDoc), mbUpdated(false) {} - - virtual ~UpdateRefHandler() {} + UpdateRefOnCopy(const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz, ScDocument* pUndoDoc) : + maRange(rRange), mnDx(nDx), mnDy(nDy), mnDz(nDz), mpUndoDoc(pUndoDoc), mbUpdated(false) {} bool isUpdated() const { return mbUpdated; } @@ -2031,23 +2028,11 @@ public: sc::formula_block::iterator itEnd = it; std::advance(itEnd, nDataSize); - size_t nRow = node.position + nOffset; - for (; it != itEnd; ++it, ++nRow) - updateReference(**it, static_cast<SCROW>(nRow)); - } - - virtual void updateReference(ScFormulaCell& rCell, SCROW nRow) = 0; -}; - -class UpdateRefOnCopy : public UpdateRefHandler -{ -public: - UpdateRefOnCopy(const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz, ScDocument* pUndoDoc) : - UpdateRefHandler(rRange, nDx, nDy, nDz, URM_COPY, pUndoDoc) {} - - virtual void updateReference(ScFormulaCell& rCell, SCROW /*nRow*/) - { - mbUpdated |= rCell.UpdateReference(meMode, maRange, mnDx, mnDy, mnDz, mpUndoDoc); + for (; it != itEnd; ++it) + { + ScFormulaCell& rCell = **it; + mbUpdated |= rCell.UpdateReference(URM_COPY, maRange, mnDx, mnDy, mnDz, mpUndoDoc); + } } }; |