summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
{