diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/odp/tdf74670.odp | bin | 0 -> 11786 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml3.cxx | 26 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/tdf74670.odp b/sd/qa/unit/data/odp/tdf74670.odp Binary files differnew file mode 100644 index 000000000000..98e223eb0725 --- /dev/null +++ b/sd/qa/unit/data/odp/tdf74670.odp diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 776d436b7edf..3f4bec336ef1 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -106,6 +106,7 @@ public: void testTdf147121(); void testTdf140912_PicturePlaceholder(); void testEnhancedPathViewBox(); + void testTdf74670(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -182,6 +183,7 @@ public: CPPUNIT_TEST(testTdf147121); CPPUNIT_TEST(testTdf140912_PicturePlaceholder); CPPUNIT_TEST(testEnhancedPathViewBox); + CPPUNIT_TEST(testTdf74670); CPPUNIT_TEST_SUITE_END(); virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override @@ -1893,6 +1895,30 @@ void SdOOXMLExportTest3::testEnhancedPathViewBox() CPPUNIT_ASSERT_EQUAL(sal_Int32(2045), aBoundRectangle.Width); } +void SdOOXMLExportTest3::testTdf74670() +{ + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf74670.odp"), ODP); + utl::TempFile tmpfile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tmpfile); + xDocShRef->DoClose(); + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess + = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), + tmpfile.GetURL()); + const uno::Sequence<OUString> aNames(xNameAccess->getElementNames()); + int nImageFiles = 0; + for (const auto& rElementName : aNames) + if (rElementName.startsWith("ppt/media/image")) + nImageFiles++; + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 2 + // i.e. the embedded picture would have been saved twice. + CPPUNIT_ASSERT_EQUAL(1, nImageFiles); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest3); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 07be6521d678..8823cbd00d53 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -428,6 +428,7 @@ bool PowerPointExport::importDocument() noexcept bool PowerPointExport::exportDocument() { DrawingML::ResetCounters(); + DrawingML::PushExportGraphics(); maShapeMap.clear(); mXModel = getModel(); @@ -504,6 +505,7 @@ bool PowerPointExport::exportDocument() commitStorage(); + DrawingML::PopExportGraphics(); maShapeMap.clear(); maAuthors.clear(); maRelId.clear(); |