diff options
-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 { |