diff options
author | Eike Rathke <erack@redhat.com> | 2014-12-18 20:07:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-04 20:54:56 +0000 |
commit | f303896706144cd25aa907805db6ca8bf338bb13 (patch) | |
tree | 53c78e3a3efeba6322100ae6b7d7ce5b5f43603c | |
parent | b5ab92248e80a3ff8869a7e731ab70a948531280 (diff) |
fdo#68385 update references only if cut originates from the same document
Change-Id: Ia7b27309251cf9e47505c58d8ed0172d134280f4
(cherry picked from commit f2ac9fab2677a6a718f251baef75d3cae96d1f01)
Reviewed-on: https://gerrit.libreoffice.org/13530
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/core/data/document.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index c6c3196ceeee..b423f05b1da2 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2552,11 +2552,16 @@ void ScDocument::CopyBlockFromClip( aRefCxt.mnTabDelta = nDz; if (rCxt.getClipDoc()->GetClipParam().mbCutMode) { - bool bOldInserting = IsInsertingFromOtherDoc(); - SetInsertingFromOtherDoc( true); - aRefCxt.meMode = URM_MOVE; - UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); - SetInsertingFromOtherDoc( bOldInserting); + // Update references only if cut originates from the same + // document we are pasting into. + if (rCxt.getClipDoc()->GetPool() == GetPool()) + { + bool bOldInserting = IsInsertingFromOtherDoc(); + SetInsertingFromOtherDoc( true); + aRefCxt.meMode = URM_MOVE; + UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); + SetInsertingFromOtherDoc( bOldInserting); + } } else { |