diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-17 20:03:10 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-18 12:41:09 +0200 |
commit | a8bba60e8b655167ad91edcd0c2d1723d525b546 (patch) | |
tree | 4ecb80c1f38c30f8856d097801bf7ecbfd36b2d6 /sd/qa/unit | |
parent | 3c3a371c799d00475deb13b4c3e0a8860c7e4fb3 (diff) |
tdf#125346: PPTX export: Shape has wrong fill color comming from theme
Write the correct theme path to the InteropGrabBag, the same path
what is generated and checked in the export code.
Change-Id: I32617c1a11cf3bafb142f7c8839b498aaac49aa0
Reviewed-on: https://gerrit.libreoffice.org/72500
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd/qa/unit')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf125346.pptx | bin | 0 -> 22079 bytes | |||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf125346_2.pptx | bin | 0 -> 24482 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 75 |
3 files changed, 75 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf125346.pptx b/sd/qa/unit/data/pptx/tdf125346.pptx Binary files differnew file mode 100644 index 000000000000..32fbbdf52e96 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf125346.pptx diff --git a/sd/qa/unit/data/pptx/tdf125346_2.pptx b/sd/qa/unit/data/pptx/tdf125346_2.pptx Binary files differnew file mode 100644 index 000000000000..53225581026e --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf125346_2.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index ba6bd727845c..3fd98f4b99bb 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -200,6 +200,8 @@ public: void testPotxExport(); void testTdf44223(); void testSmartArtPreserve(); + void testTdf125346(); + void testTdf125346_2(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -282,6 +284,8 @@ public: CPPUNIT_TEST(testPotxExport); CPPUNIT_TEST(testTdf44223); CPPUNIT_TEST(testSmartArtPreserve); + CPPUNIT_TEST(testTdf125346); + CPPUNIT_TEST(testTdf125346_2); CPPUNIT_TEST_SUITE_END(); @@ -2167,6 +2171,77 @@ void SdOOXMLExportTest2::testSmartArtPreserve() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf125346() +{ + // There are two themes in the test document, make sure we use the right theme + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125346.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW ); + + drawing::FillStyle aFillStyle( drawing::FillStyle_NONE ); + xPropSet->getPropertyValue("FillStyle") >>= aFillStyle; + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle); + + sal_Int32 nFillColor; + xPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor); + + xDocShRef->DoClose(); +} + +void SdOOXMLExportTest2::testTdf125346_2() +{ + // There are two themes in the test document, make sure we use the right theme + // Test more slides with different themes + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125346_2.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + { + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW ); + + drawing::FillStyle aFillStyle( drawing::FillStyle_NONE ); + xPropSet->getPropertyValue("FillStyle") >>= aFillStyle; + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle); + + sal_Int32 nFillColor; + xPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor); + } + + { + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 1, xDocShRef ) ); + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW ); + + drawing::FillStyle aFillStyle( drawing::FillStyle_NONE ); + xPropSet->getPropertyValue("FillStyle") >>= aFillStyle; + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle); + + sal_Int32 nFillColor; + xPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x052F61), nFillColor); + } + + { + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 2, xDocShRef ) ); + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_SET_THROW ); + + drawing::FillStyle aFillStyle( drawing::FillStyle_NONE ); + xPropSet->getPropertyValue("FillStyle") >>= aFillStyle; + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, aFillStyle); + + sal_Int32 nFillColor; + xPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x90C226), nFillColor); + } + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); |