From 0c12aa670b83b76241077dfb8bc21f40a55b1667 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 6 Feb 2014 14:11:43 -0500 Subject: fdo#74573: Skip deletion of destination area when 'skip empty' is on. Also, adjust handling of mix document aka paste functions with this change. When using paste function (add, subtract, etc), the behavior between the 'skip empty' flag on and off makes no difference. Let's set the flag to off when paste function is used. Change-Id: I67724ba923c9260b2c14464e4123b8445712dbaf --- sc/source/core/data/column3.cxx | 1 - sc/source/core/data/document.cxx | 3 ++- sc/source/ui/view/viewfun3.cxx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index fb6518e1db9d..b97e396d12f5 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -731,7 +731,6 @@ public: void operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize) { - SCROW nSrcRow1 = node.position + nOffset; bool bCopyCellNotes = mrCxt.isCloneNotes(); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 9f5b3bb36fa5..fdbb1fa198e3 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2690,7 +2690,8 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar SCCOL nCol2 = pRange->aEnd.Col(); SCROW nRow2 = pRange->aEnd.Row(); - DeleteArea(nCol1, nRow1, nCol2, nRow2, rMark, nDelFlag); + if (!bSkipAttrForEmpty) + DeleteArea(nCol1, nRow1, nCol2, nRow2, rMark, nDelFlag); if (CopyOneCellFromClip(aCxt, nCol1, nRow1, nCol2, nRow2)) continue; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index e501458c8685..fd16a6011e78 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1188,8 +1188,9 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, // ScDocument* pMixDoc = NULL; - if ( bSkipEmpty || nFunction ) + if (nFunction) { + bSkipEmpty = false; if ( nFlags & IDF_CONTENTS ) { pMixDoc = new ScDocument( SCDOCMODE_UNDO ); -- cgit