summaryrefslogtreecommitdiff
path: root/sc/source/core/data/document.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-18 14:36:33 -0500
committerEike Rathke <erack@redhat.com>2013-01-21 20:20:30 +0000
commit1ecb30cede30fea5a6a239d3d8da8ebbf8b79bf9 (patch)
treea2af9c8eb6fda7e05403e2ab7d1360414d161376 /sc/source/core/data/document.cxx
parentd820394160f7448c17934d9d6fabb17263ce2696 (diff)
fdo#58988, fdo#58562: Populate draw clip document with data for charts.
Without populating the clip document, copying a chart (or charts) into clipboard makes the charts lose all their referenced data, which causes the pasted chart to appear empty. Conflicts: sc/source/ui/view/drawvie4.cxx Change-Id: I0e7ce7cfbcdb3c9f120c6f0c72c58ab320901e6b Reviewed-on: https://gerrit.libreoffice.org/1757 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/core/data/document.cxx')
-rw-r--r--sc/source/core/data/document.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 65e904f1c923..95018d741a2f 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1956,6 +1956,21 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam,
pClipDoc->ExtendMerge(aClipRange, true);
}
+void ScDocument::CopyStaticToDocument(const ScRange& rSrcRange, SCTAB nDestTab, ScDocument* pDestDoc)
+{
+ if (!pDestDoc)
+ return;
+
+ ScTable* pSrcTab = rSrcRange.aStart.Tab() < static_cast<SCTAB>(maTabs.size()) ? maTabs[rSrcRange.aStart.Tab()] : NULL;
+ ScTable* pDestTab = nDestTab < static_cast<SCTAB>(pDestDoc->maTabs.size()) ? pDestDoc->maTabs[nDestTab] : NULL;
+
+ if (!pSrcTab || !pDestTab)
+ return;
+
+ pSrcTab->CopyStaticToDocument(
+ rSrcRange.aStart.Col(), rSrcRange.aStart.Row(), rSrcRange.aEnd.Col(), rSrcRange.aEnd.Row(), pDestTab);
+}
+
void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1,
SCCOL nCol2, SCROW nRow2,
SCTAB nTab, ScDocument* pClipDoc)