summaryrefslogtreecommitdiffstats
path: root/sc/qa/unit/scshapetest.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:44:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:44:47 +0000
commit91fe6b97952aa6f7cef58327fd085a17db38ad95 (patch)
tree7a4412295bfb80e15a4936fe67d4bd7b96458ce8 /sc/qa/unit/scshapetest.cxx
parentReleasing progress-linux version 4:24.2.1-4~progress7.99u1. (diff)
downloadlibreoffice-91fe6b97952aa6f7cef58327fd085a17db38ad95.tar.xz
libreoffice-91fe6b97952aa6f7cef58327fd085a17db38ad95.zip
Merging upstream version 4:24.2.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/qa/unit/scshapetest.cxx')
-rw-r--r--sc/qa/unit/scshapetest.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index b5083544f1..5e48270053 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -1207,6 +1207,30 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf154821_shape_in_group)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aRectOrig, aRectReload, 1);
}
+CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160003_copy_page_anchored)
+{
+ // Load a document, which has a chart anchored to page on sheet2. Copy&paste to other document
+ // had lost the chart object.
+ createScDoc("ods/tdf160003_page_anchored_object.ods");
+
+ // copy range with chart
+ goToCell("$Sheet2.$A$1:$L$24");
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+
+ // close document and create new one
+ createScDoc();
+
+ // paste clipboard
+ goToCell("$Sheet1.$A$1");
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+
+ // Make sure the chart object exists.
+ ScDocument* pDoc = getScDoc();
+ ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ const SdrPage* pPage = pDrawLayer->GetPage(0);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */