diff options
author | Eike Rathke <erack@redhat.com> | 2016-05-30 18:30:48 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-30 17:13:28 +0000 |
commit | 800920a7b0600b1677d231c514345fe9f6687d82 (patch) | |
tree | a4d739ffb8d507732a88f23c0cf600e36f18fbe4 | |
parent | 543822b6b661ebbffad9339b5395ea810ba75de2 (diff) |
Resolves: tdf#97158 CopyOneCellFromClip() does not handle multiple sheets
... so check that and bail out to let the remainder of CopyFromClip()
handle it.
Change-Id: I9d139de905fd108ae41fed79a38860058525272c
(cherry picked from commit dc9eac5a5f4f247ba5efb67931ffde61f2c8d5b6)
Reviewed-on: https://gerrit.libreoffice.org/25678
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document10.cxx | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 5696f260f789..01eadaf9fc1c 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1419,7 +1419,7 @@ public: sc::CopyFromClipContext& rCxt, const ScMarkData& rMark, sc::ColumnSpanSet& rBroadcastSpans ); bool CopyOneCellFromClip( - sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); + sc::CopyFromClipContext& rCxt, const ScMarkData& rMark, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); void CopyBlockFromClip( sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark, SCsCOL nDx, SCsROW nDy ); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index f5ad18c25d6f..224908de5a55 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2806,7 +2806,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar else DeleteArea(nCol1, nRow1, nCol2, nRow2, rMark, nDelFlag, false, &aBroadcastSpans); - if (CopyOneCellFromClip(aCxt, nCol1, nRow1, nCol2, nRow2)) + if (CopyOneCellFromClip(aCxt, rMark, nCol1, nRow1, nCol2, nRow2)) continue; SCCOL nC1 = nCol1; diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 59aff1326336..e99d0b4c39b0 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -65,7 +65,7 @@ void ScDocument::DeleteBeforeCopyFromClip( } bool ScDocument::CopyOneCellFromClip( - sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) + sc::CopyFromClipContext& rCxt, const ScMarkData& rMark, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) { ScDocument* pClipDoc = rCxt.getClipDoc(); if (pClipDoc->GetClipParam().mbCutMode) @@ -82,6 +82,11 @@ bool ScDocument::CopyOneCellFromClip( if (nDestColSize < nSrcColSize) return false; + if (rCxt.getClipDoc()->maTabs.size() > 1 || rMark.GetSelectCount() > 1) + // Copying from multiple source sheets or to multiple destination + // sheets is not handled here. + return false; + ScAddress aSrcPos = aClipRange.aStart; for (SCCOL nCol = aClipRange.aStart.Col(); nCol <= aClipRange.aEnd.Col(); ++nCol) |