From cb57a432ba98ffe197c8fd2528e4b363c3285cc4 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 10 Apr 2017 23:05:09 +0200 Subject: call UpdateReference also for single cell copying, tdf#105245 Change-Id: I5fed22d2835466cbd07f8dbd917e9f881b7b2832 Reviewed-on: https://gerrit.libreoffice.org/36393 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- sc/source/core/data/document10.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 896499995388..bae227dbb3a0 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -125,6 +125,25 @@ bool ScDocument::CopyOneCellFromClip( maTabs[i]->CopyOneCellFromClip(rCxt, nCol1, nRow1, nCol2, nRow2, aClipRange.aStart.Row(), pSrcTab); } + sc::RefUpdateContext aRefCxt(*this); + aRefCxt.maRange = ScRange(nCol1, nRow1, rCxt.getTabStart(), nCol2, nRow2, nTabEnd); + aRefCxt.mnColDelta = nCol1 - aSrcPos.Col(); + aRefCxt.mnRowDelta = nRow1 - aSrcPos.Row(); + aRefCxt.mnTabDelta = rCxt.getTabStart() - aSrcPos.Tab(); + if (rCxt.getClipDoc()->GetClipParam().mbCutMode) + { + if (rCxt.getClipDoc()->GetPool() == GetPool()) + { + aRefCxt.meMode = URM_MOVE; + UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); + } + } + else + { + aRefCxt.meMode = URM_COPY; + UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); + } + return true; } -- cgit v1.2.3