summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-12-18 20:07:55 +0100
committerEike Rathke <erack@redhat.com>2014-12-18 20:11:14 +0100
commitf2ac9fab2677a6a718f251baef75d3cae96d1f01 (patch)
treedcc3bac5e33d3482898b95d2a2dfa622b8a1be3d
parent64c479e9da02f724e1870649c99fac92f5f27cd3 (diff)
fdo#68385 update references only if cut originates from the same document
Change-Id: Ia7b27309251cf9e47505c58d8ed0172d134280f4
-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 15c6914891e7..1a377bbefdcf 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2548,11 +2548,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
{