summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-09-10 00:43:05 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-09-12 13:22:07 -0400
commitea280cef9c5293a1865786a2e8736bb9524f8751 (patch)
treef66823d542fb64568657ea208ea01edb09937613 /sc
parentAllow paste when the dest range is a multiple of the source range. (diff)
downloadcore-ea280cef9c5293a1865786a2e8736bb9524f8751.tar.gz
core-ea280cef9c5293a1865786a2e8736bb9524f8751.zip
Added code to handle paste functions and skip empties.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/viewfun3.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e839a7089181..aaa07f94577a 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1792,6 +1792,21 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
}
}
+ std::auto_ptr<ScDocument> pMixDoc;
+ if (bSkipEmpty || nFunction)
+ {
+ if (nFlags & IDF_CONTENTS)
+ {
+ pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO));
+ pMixDoc->InitUndoSelected(pDoc, aMark, false, false);
+ for (size_t i = 0, n = aRanges.size(); i < n; ++i)
+ {
+ pDoc->CopyToDocument(
+ *aRanges[i], IDF_CONTENTS, false, pMixDoc.get(), &aMark, true);
+ }
+ }
+ }
+
if (nFlags & IDF_OBJECTS)
pDocSh->MakeDrawLayer();
if (pDoc->IsUndoEnabled())
@@ -1807,6 +1822,12 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
false, false, true, bSkipEmpty, NULL);
}
+ if (pMixDoc.get())
+ {
+ for (size_t i = 0, n = aRanges.size(); i < n; ++i)
+ pDoc->MixDocument(*aRanges[i], nFunction, bSkipEmpty, pMixDoc.get());
+ }
+
AdjustBlockHeight(); // update row heights before pasting objects
// Then paste the objects.