From adc042f95d3dbd65b778260025d59283146916e5 Mon Sep 17 00:00:00 2001 From: Tünde Tóth Date: Tue, 13 Sep 2022 10:29:03 +0200 Subject: tdf#124333 PPTX import: fix Z-order of embedded OLE objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Choose mc:Choice in a:graphicData element if the selected p:oleObj element has a shape id to avoid of shape duplication which created also bad layout/overlapping because of the different Z-order of the duplicated shape. Change-Id: Idecff4903c2d637bc82353f13352cac72413cec1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140041 Tested-by: László Németh Reviewed-by: László Németh --- sd/qa/unit/data/pptx/ole.pptx | Bin 0 -> 41588 bytes sd/qa/unit/export-tests-ooxml3.cxx | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 sd/qa/unit/data/pptx/ole.pptx (limited to 'sd') diff --git a/sd/qa/unit/data/pptx/ole.pptx b/sd/qa/unit/data/pptx/ole.pptx new file mode 100644 index 000000000000..b998e79e0d66 Binary files /dev/null and b/sd/qa/unit/data/pptx/ole.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index c12a1f0ec4bd..e2ef6928104f 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -122,6 +122,7 @@ public: void testTdf149551_tbrl90(); void testTdf149551_btlr(); void testTdf94122_autoColor(); + void testTdf124333(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -209,6 +210,7 @@ public: CPPUNIT_TEST(testTdf149551_tbrl90); CPPUNIT_TEST(testTdf149551_btlr); CPPUNIT_TEST(testTdf94122_autoColor); + CPPUNIT_TEST(testTdf124333); CPPUNIT_TEST_SUITE_END(); virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override @@ -2260,6 +2262,25 @@ void SdOOXMLExportTest3::testTdf94122_autoColor() "val", "000000"); } +void SdOOXMLExportTest3::testTdf124333() +{ + // Document contains one rectangle and one embedded OLE object. + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/ole.pptx"), PPTX); + + // Without the fix in place, the number of shapes was 3. + CPPUNIT_ASSERT_EQUAL_MESSAGE("number of shapes is incorrect", sal_Int32(2), + getPage(0, xDocShRef)->getCount()); + + xDocShRef = saveAndReload(xDocShRef.get(), PPTX); + + // Check number of shapes after export. + CPPUNIT_ASSERT_EQUAL_MESSAGE("number of shapes is incorrect after export", sal_Int32(2), + getPage(0, xDocShRef)->getCount()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest3); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit