diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-20 18:27:33 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-05-21 08:02:44 +0200 |
commit | 4dac3a649a035bcd093ac5c175c9a0e9723ef1c2 (patch) | |
tree | 4e4436090751ea2af95a4ffb0ecb3a7ea879eb6a /sd | |
parent | 30b8d352bdfd2128769f3ae1e8a3616118d3e754 (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.
Reviewed-on: https://gerrit.libreoffice.org/72596
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 259d01a34d27df2fbfd11c3bf6fe9dc508ff6ac2)
Change-Id: I09d26238a9c2b501279e6749687dc535e614bbd6
Reviewed-on: https://gerrit.libreoffice.org/72617
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@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 792824650251..63c62803233d 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -145,6 +145,9 @@ public: void testOpenDocumentAsReadOnly(); void testTdf125346(); void testTdf125346_2(); + void testTdf125360(); + void testTdf125360_1(); + void testTdf125360_2(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -213,6 +216,9 @@ public: CPPUNIT_TEST(testOpenDocumentAsReadOnly); CPPUNIT_TEST(testTdf125346); CPPUNIT_TEST(testTdf125346_2); + CPPUNIT_TEST(testTdf125360); + CPPUNIT_TEST(testTdf125360_1); + CPPUNIT_TEST(testTdf125360_2); CPPUNIT_TEST_SUITE_END(); @@ -1805,6 +1811,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(); |