summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-09-05 19:22:35 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-09-06 08:00:02 +0200
commitced915bf4c4dfc890193bbea269ef74995ecc888 (patch)
tree639f36cd290d365b2156c9b8405e0ff3f544a2a3
parent0417fb9ccd5a5467107621b5ac5ba1edcda71c68 (diff)
tdf#127379: PPTX: Gradient background fill of a slide is lost during RT.
Change-Id: I149bf161f53d566d461347e00d04fc45394bc051 Reviewed-on: https://gerrit.libreoffice.org/78670 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--sd/qa/unit/data/odp/tdf127379.odpbin0 -> 19471 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx28
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx1
3 files changed, 28 insertions, 1 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf127379.odp
Binary files 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;