diff options
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 5 | ||||
-rwxr-xr-x | sd/qa/unit/data/pptx/tdf105739.pptx | bin | 0 -> 30709 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 34 |
3 files changed, 38 insertions, 1 deletions
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index ec7932548824..f79131d58384 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -173,7 +173,10 @@ void SlidePersist::createBackground( const XmlFilterBase& rFilterBase ) sal_Int32 nPhClr = maBackgroundColor.isUsed() ? maBackgroundColor.getColor( rFilterBase.getGraphicHelper() ) : API_RGB_TRANSPARENT; - ::oox::drawingml::ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() ); + oox::drawingml::ShapePropertyIds aPropertyIds = (oox::drawingml::ShapePropertyInfo::DEFAULT).mrPropertyIds; + aPropertyIds[oox::drawingml::ShapeProperty::FillGradient] = PROP_FillGradientName; + oox::drawingml::ShapePropertyInfo aPropInfo( aPropertyIds, true, false, true, false ); + oox::drawingml::ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper(), aPropInfo ); mpBackgroundPropertiesPtr->pushToPropMap( aPropMap, rFilterBase.getGraphicHelper(), 0, nPhClr ); PropertySet( mxPage ).setProperty( PROP_Background, aPropMap.makePropertySet() ); } diff --git a/sd/qa/unit/data/pptx/tdf105739.pptx b/sd/qa/unit/data/pptx/tdf105739.pptx Binary files differnew file mode 100755 index 000000000000..08e26f55a91d --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf105739.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 540e80022d7d..e2130861e515 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -103,6 +103,7 @@ public: void testTdf99224(); void testTdf92076(); void testTdf59046(); + void testTdf105739(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -129,6 +130,7 @@ public: CPPUNIT_TEST(testTdf99224); CPPUNIT_TEST(testTdf92076); CPPUNIT_TEST(testTdf59046); + CPPUNIT_TEST(testTdf105739); CPPUNIT_TEST_SUITE_END(); @@ -757,6 +759,38 @@ void SdOOXMLExportTest2::testTdf59046() assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:custGeom/a:pathLst/a:path", 1); } +void SdOOXMLExportTest2::testTdf105739() +{ + // Gradient was lost during saving to ODP + sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf105739.pptx"), PPTX); + utl::TempFile tempFile; + xShell = saveAndReload(xShell.get(), ODP, &tempFile); + uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell); + uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY); + uno::Any aAny = xPropSet->getPropertyValue("Background"); + CPPUNIT_ASSERT(aAny.hasValue()); + if (aAny.hasValue()) + { + uno::Reference< beans::XPropertySet > aXBackgroundPropSet; + aAny >>= aXBackgroundPropSet; + + // Test fill type + drawing::FillStyle aFillStyle(drawing::FillStyle_NONE); + aXBackgroundPropSet->getPropertyValue("FillStyle") >>= aFillStyle; + CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_GRADIENT, aFillStyle); + + // Test gradient properties + com::sun::star::awt::Gradient aFillGradient; + aXBackgroundPropSet->getPropertyValue("FillGradient") >>= aFillGradient; + CPPUNIT_ASSERT_EQUAL(awt::GradientStyle_LINEAR, aFillGradient.Style); + CPPUNIT_ASSERT_EQUAL(util::Color(0xff0000), aFillGradient.StartColor); + CPPUNIT_ASSERT_EQUAL(util::Color(0x00b050), aFillGradient.EndColor); + } + + xShell->DoClose(); +} + + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); |