diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-18 17:42:25 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-20 16:46:19 +0200 |
commit | 259d01a34d27df2fbfd11c3bf6fe9dc508ff6ac2 (patch) | |
tree | b1b8acf552ec6cea17a16f2044eb3e4b33623ea6 /sd | |
parent | 0385f4235850b8c3949f6564e1e5b79cbe56b146 (diff) |
tdf#125360: PPTX: Shape fill transparency is not exported
.. if the original shape fill is defined with a theme
Override the alpha value with the current value get from
FillTransparence API attirbute even if the color is defined
with a style or a color scheme.
Change-Id: I09d26238a9c2b501279e6749687dc535e614bbd6
Reviewed-on: https://gerrit.libreoffice.org/72596
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf125360.pptx | bin | 0 -> 15379 bytes | |||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf125360_1.pptx | bin | 0 -> 15480 bytes | |||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf125360_2.pptx | bin | 0 -> 15213 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 76 |
4 files changed, 76 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf125360.pptx b/sd/qa/unit/data/pptx/tdf125360.pptx Binary files differnew file mode 100644 index 000000000000..c1a3045bc17b --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf125360.pptx diff --git a/sd/qa/unit/data/pptx/tdf125360_1.pptx b/sd/qa/unit/data/pptx/tdf125360_1.pptx Binary files differnew file mode 100644 index 000000000000..cfc5798369db --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf125360_1.pptx diff --git a/sd/qa/unit/data/pptx/tdf125360_2.pptx b/sd/qa/unit/data/pptx/tdf125360_2.pptx Binary files differnew file mode 100644 index 000000000000..4f6b16455f71 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf125360_2.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 3fd98f4b99bb..bc987a018af2 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -202,6 +202,9 @@ public: void testSmartArtPreserve(); void testTdf125346(); void testTdf125346_2(); + void testTdf125360(); + void testTdf125360_1(); + void testTdf125360_2(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -286,6 +289,9 @@ public: CPPUNIT_TEST(testSmartArtPreserve); CPPUNIT_TEST(testTdf125346); CPPUNIT_TEST(testTdf125346_2); + CPPUNIT_TEST(testTdf125360); + CPPUNIT_TEST(testTdf125360_1); + CPPUNIT_TEST(testTdf125360_2); CPPUNIT_TEST_SUITE_END(); @@ -2242,6 +2248,76 @@ void SdOOXMLExportTest2::testTdf125346_2() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf125360() +{ + // Check whether the changed fill transparency is exported correctly. + // Color is defined by shape style + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125360.pptx"), PPTX); + + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + + xShape->setPropertyValue("FillTransparence", uno::makeAny(static_cast<sal_Int32>(23))); + + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + xShape.set( getShapeFromPage( 0, 0, xDocShRef ) ); + + sal_Int32 nTransparence = 0; + xShape->getPropertyValue("FillTransparence") >>= nTransparence; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nTransparence); + + xDocShRef->DoClose(); +} + +void SdOOXMLExportTest2::testTdf125360_1() +{ + // Check whether the changed fill transparency is exported correctly. + // Color is defined by color scheme + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125360_1.pptx"), PPTX); + + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + + xShape->setPropertyValue("FillTransparence", uno::makeAny(static_cast<sal_Int32>(23))); + + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + xShape.set( getShapeFromPage( 0, 0, xDocShRef ) ); + + sal_Int32 nTransparence = 0; + xShape->getPropertyValue("FillTransparence") >>= nTransparence; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nTransparence); + + xDocShRef->DoClose(); +} + +void SdOOXMLExportTest2::testTdf125360_2() +{ + // Check whether the changed fill transparency is exported correctly. + // Color is defined by color scheme with a transparency + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf125360_2.pptx"), PPTX); + + uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) ); + + sal_Int32 nTransparence = 0; + xShape->getPropertyValue("FillTransparence") >>= nTransparence; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(82), nTransparence); + + xShape->setPropertyValue("FillTransparence", uno::makeAny(static_cast<sal_Int32>(23))); + + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + xShape.set( getShapeFromPage( 0, 0, xDocShRef ) ); + + nTransparence = 0; + xShape->getPropertyValue("FillTransparence") >>= nTransparence; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(23), nTransparence); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); |