From ced915bf4c4dfc890193bbea269ef74995ecc888 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Thu, 5 Sep 2019 19:22:35 +0200 Subject: tdf#127379: PPTX: Gradient background fill of a slide is lost during RT. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I149bf161f53d566d461347e00d04fc45394bc051 Reviewed-on: https://gerrit.libreoffice.org/78670 Tested-by: Jenkins Reviewed-by: Tamás Zolnai --- sd/qa/unit/data/odp/tdf127379.odp | Bin 0 -> 19471 bytes sd/qa/unit/export-tests-ooxml2.cxx | 28 ++++++++++++++++++++++++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 1 - 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 sd/qa/unit/data/odp/tdf127379.odp diff --git a/sd/qa/unit/data/odp/tdf127379.odp b/sd/qa/unit/data/odp/tdf127379.odp new file mode 100644 index 000000000000..91602c79623f Binary files /dev/null and b/sd/qa/unit/data/odp/tdf127379.odp differ diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index b006cbdc9c68..3944a8e3538b 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -178,6 +178,7 @@ public: void testTdf126234(); void testTdf126741(); void testTdf127372(); + void testTdf127379(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -274,6 +275,7 @@ public: CPPUNIT_TEST(testTdf126234); CPPUNIT_TEST(testTdf126741); CPPUNIT_TEST(testTdf127372); + CPPUNIT_TEST(testTdf127379); CPPUNIT_TEST_SUITE_END(); @@ -2552,6 +2554,32 @@ void SdOOXMLExportTest2::testTdf127372() CPPUNIT_ASSERT_EQUAL(sal_Int32(0x000000), aTransparenceGradient.EndColor); } +void SdOOXMLExportTest2::testTdf127379() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf127379.odp"), ODP); + xDocShRef = saveAndReload( xDocShRef.get(), PPTX ); + uno::Reference< drawing::XDrawPagesSupplier > xDoc( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDoc->getDrawPages()->getCount() ); + + uno::Reference< drawing::XDrawPage > xPage( getPage( 0, xDocShRef ) ); + uno::Reference< beans::XPropertySet > xPropSet( xPage, uno::UNO_QUERY ); + + uno::Any aAny = xPropSet->getPropertyValue( "Background" ); + CPPUNIT_ASSERT_MESSAGE("Slide background is missing", aAny.hasValue()); + uno::Reference< beans::XPropertySet > aXBackgroundPropSet; + aAny >>= aXBackgroundPropSet; + + drawing::FillStyle aFillStyle(drawing::FillStyle_NONE); + aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle; + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle); + + awt::Gradient aGradient; + CPPUNIT_ASSERT(aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aGradient); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFF0000), aGradient.StartColor); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x2A6099), aGradient.EndColor); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index b2b8512267f7..47cf5be5b1d2 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -464,7 +464,6 @@ void PowerPointExport::ImplWriteBackground(const FSHelperPtr& pFS, const Referen mAny >>= aFillStyle; if (aFillStyle == FillStyle_NONE || - aFillStyle == FillStyle_GRADIENT || aFillStyle == FillStyle_HATCH) return; -- cgit