summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-18 20:07:55 +0100
committerAndras Timar <andras.timar@collabora.com>2014-12-18 22:51:57 +0100
commitd96e5eb9d316117f3f560d77c9858737d7e58c9d (patch)
treee57744b49f58fae270b928beb07271a5ee4772ec
parent04a9c1c90cc2e2d969b712b3b7a255d286d19b84 (diff)
fdo#68385 update references only if cut originates from the same document
Change-Id: Ia7b27309251cf9e47505c58d8ed0172d134280f4 (cherry picked from commit f2ac9fab2677a6a718f251baef75d3cae96d1f01)
-rw-r--r--sc/source/core/data/document.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index e7963b92b695..751204dcb9db 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2551,11 +2551,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
{