diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-06 20:52:16 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-07 20:20:02 +0200 |
commit | ae3aabdb951643af8d2f7aee9c9f900245e5b384 (patch) | |
tree | 127b131199dd266b16467b796d2734caad1eff49 /sd/qa | |
parent | ba84300b82844921c4421a468e290aeca68fa694 (diff) |
PPTX: Fix import / export of image transparency
Change-Id: Ib07c606083b833389fcb82aac57ca8535d6e861f
Reviewed-on: https://gerrit.libreoffice.org/71916
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/odp/image_transparency.odp | bin | 0 -> 24448 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/image_transparency.odp b/sd/qa/unit/data/odp/image_transparency.odp Binary files differnew file mode 100644 index 000000000000..6d3f6c232d91 --- /dev/null +++ b/sd/qa/unit/data/odp/image_transparency.odp diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index e8ce39dc68a0..25cd15c63131 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -103,6 +103,7 @@ public: void testTdf112633(); void testCustomXml(); void testTdf94238(); + void testPictureTransparency(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); @@ -134,6 +135,7 @@ public: CPPUNIT_TEST(testTdf112633); CPPUNIT_TEST(testCustomXml); CPPUNIT_TEST(testTdf94238); + CPPUNIT_TEST(testPictureTransparency); CPPUNIT_TEST_SUITE_END(); @@ -882,6 +884,30 @@ void SdOOXMLExportTest1::testTdf94238() xDocShRef->DoClose(); } +void SdOOXMLExportTest1::testPictureTransparency() +{ + // Load document and export it to a temporary file. + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/image_transparency.odp"), ODP); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), + uno::UNO_QUERY); + CPPUNIT_ASSERT(xDoc.is()); + + uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xPage.is()); + + uno::Reference<beans::XPropertySet> xGraphicShape(getShape(0, xPage)); + CPPUNIT_ASSERT(xGraphicShape.is()); + + sal_Int16 nTransparency = 0; + CPPUNIT_ASSERT(xGraphicShape->getPropertyValue("Transparency") >>= nTransparency); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(51), nTransparency); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1); CPPUNIT_PLUGIN_IMPLEMENT(); |