diff options
author | Eike Rathke <erack@redhat.com> | 2014-12-18 20:07:55 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-12-18 20:16:58 +0100 |
commit | 9f4c743dafea9b30aa4deb2f53ac5e2cdf3b49f0 (patch) | |
tree | c701be45ab1b889d39526cb69cd866ca8c2d5075 | |
parent | 4e8ae0f8187a9d3fa77d737f5de248cfd9b0ed55 (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.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 252352cc5e19..58ade9cf72c1 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 { |