diff options
author | Eike Rathke <erack@redhat.com> | 2014-12-18 20:07:55 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-01-08 15:09:21 +0100 |
commit | 305f647ab32b392b1ffb93fdcd1723906205cbef (patch) | |
tree | 2c9dd9615739e9a67c1690eb0f2286f62211f291 /sc/source/core | |
parent | d2dbc26141ff76dfd0f3659004af5ae770f60f05 (diff) |
fdo#68385 update references only if cut originates from the same document
Change-Id: Ia7b27309251cf9e47505c58d8ed0172d134280f4
(cherry picked from commit f2ac9fab2677a6a718f251baef75d3cae96d1f01)
Reviewed-on: https://gerrit.libreoffice.org/13529
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit ed92c5f1e3d0e2184672d6d31f25d0e933ebd3cd)
Diffstat (limited to 'sc/source/core')
-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 56e751b279cc..f53426a0c979 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2562,11 +2562,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 { |