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:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:44:04 +0000
commiteb358d77291eba677141bab113dc27d7aabb0f3e (patch)
tree2e96f3b5d0c79beaeb536bbf05c3b8564846e65f /sc/qa/unit/scshapetest.cxx
parentAdding debian version 4:24.2.1-4. (diff)
downloadlibreoffice-eb358d77291eba677141bab113dc27d7aabb0f3e.tar.xz
libreoffice-eb358d77291eba677141bab113dc27d7aabb0f3e.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: */