sc/source/core/data/formulacell.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit bf5408650e76bf7a285152fa32fea6562403dd31 Author: Dennis Francis <dennis.fran...@collabora.co.uk> Date: Thu Jul 13 11:35:41 2017 +0530 tdf#108758 : do not write to undo document when... ...updating references during a block move, for formula cells that are in the target range of the move operation. The fix is for formula cells that are not grouped. For the grouped case, it was already doing correctly. Added two unit tests in ucalc_formula.cxx for grouped formula and non-grouped formula cases. Reviewed-on: https://gerrit.libreoffice.org/39883 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 2caaf9bfe8d3f81517467daf36de0bd8ddd6b543) Conflicts: sc/qa/unit/ucalc.hxx sc/qa/unit/ucalc_formula.cxx Backported, excluding conflicting unit tests. Change-Id: I9f4d988f5e154f56670bd1c0cc366ee6704fb858 Reviewed-on: https://gerrit.libreoffice.org/39924 Reviewed-by: Eike Rathke <er...@redhat.com> Reviewed-by: Dennis Francis <dennis.fran...@collabora.co.uk> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index b19bfba89bc9..381fb173d4b7 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3201,7 +3201,9 @@ bool ScFormulaCell::UpdateReferenceOnMove( aUndoPos = *pUndoCellPos; ScAddress aOldPos( aPos ); - if (rCxt.maRange.In(aPos)) + bool bCellInMoveTarget = rCxt.maRange.In(aPos); + + if ( bCellInMoveTarget ) { // The cell is being moved or copied to a new position. I guess the // position has been updated prior to this call? Determine @@ -3290,7 +3292,7 @@ bool ScFormulaCell::UpdateReferenceOnMove( (bValChanged && bHasRelName ) || bOnRefMove) bNeedDirty = true; - if (pUndoDoc && (bValChanged || bRefModified || bOnRefMove)) + if (pUndoDoc && !bCellInMoveTarget && (bValChanged || bRefModified || bOnRefMove)) setOldCodeToUndo(pUndoDoc, aUndoPos, pOldCode.get(), eTempGrammar, cMatrixFlag); bValChanged = false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits