diff options
Diffstat (limited to 'sd/qa/unit/export-tests-ooxml1.cxx')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 5de8eaf770c6..f7cec3010dc7 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -90,6 +90,7 @@ public: void testRoundtripOwnLineStyles(); void testRoundtripPrstDash(); void testDashOnHairline(); + void testCustomshapeBitmapfillSrcrect(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); @@ -129,6 +130,7 @@ public: CPPUNIT_TEST(testRoundtripOwnLineStyles); CPPUNIT_TEST(testRoundtripPrstDash); CPPUNIT_TEST(testDashOnHairline); + CPPUNIT_TEST(testCustomshapeBitmapfillSrcrect); CPPUNIT_TEST_SUITE_END(); @@ -1070,6 +1072,29 @@ void SdOOXMLExportTest1::testDashOnHairline() assertXPath(pXmlDoc, sXmlPath, 11); } +void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( + m_directories.getURLFromSrc("sd/qa/unit/data/pptx/customshape-bitmapfill-srcrect.pptx"), + PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml"); + const OString sXmlPath = "//a:blipFill/a:srcRect"; + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // - XPath '//a:blipFill/a:srcRect' number of nodes is incorrect + // i.e. <a:srcRect> was exported as <a:fillRect> in <a:stretch>, which made part of the image + // invisible. + double fLeftPercent = std::round(getXPath(pXmlDoc, sXmlPath, "l").toDouble() / 1000); + CPPUNIT_ASSERT_EQUAL(4.0, fLeftPercent); + double fRightPercent = std::round(getXPath(pXmlDoc, sXmlPath, "r").toDouble() / 1000); + CPPUNIT_ASSERT_EQUAL(4.0, fRightPercent); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1); CPPUNIT_PLUGIN_IMPLEMENT(); |