summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-05-20 19:31:36 +0200
committerAndras Timar <andras.timar@collabora.com>2019-05-21 08:02:10 +0200
commit5e3a3e7d37aecd353ebab78f24e7b32a66a7df83 (patch)
tree96ec531c836ae7b4adf8e3ead027c7d7d155380c /sd
parent2b95e5bdf91204ecc03bcf98375c2620b71f1c3d (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/72618 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf125360.pptxbin0 -> 15379 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf125360_1.pptxbin0 -> 15480 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf125360_2.pptxbin0 -> 15213 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx76
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
new file mode 100644
index 000000000000..c1a3045bc17b
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf125360.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf125360_1.pptx b/sd/qa/unit/data/pptx/tdf125360_1.pptx
new file mode 100644
index 000000000000..cfc5798369db
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf125360_1.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf125360_2.pptx b/sd/qa/unit/data/pptx/tdf125360_2.pptx
new file mode 100644
index 000000000000..4f6b16455f71
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf125360_2.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index b712a7d26769..80090c1656ae 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -198,6 +198,9 @@ public:
void testTdf99213();
void testTdf125346();
void testTdf125346_2();
+ void testTdf125360();
+ void testTdf125360_1();
+ void testTdf125360_2();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -279,6 +282,9 @@ public:
CPPUNIT_TEST(testTdf99213);
CPPUNIT_TEST(testTdf125346);
CPPUNIT_TEST(testTdf125346_2);
+ CPPUNIT_TEST(testTdf125360);
+ CPPUNIT_TEST(testTdf125360_1);
+ CPPUNIT_TEST(testTdf125360_2);
CPPUNIT_TEST_SUITE_END();
@@ -2118,6 +2124,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();