summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMatus Uzak <matus.uzak@gmail.com>2016-03-08 21:44:21 +0100
committerAndras Timar <andras.timar@collabora.com>2016-06-12 23:30:27 +0200
commit6b7bbca3415b5020e8964c41675633f599a339a8 (patch)
tree7ccbe7e1e19dc221c367ecbf3e8205c3a5f8df42 /oox
parente529dd401d435a62b4a340161d61ae2e771d14d4 (diff)
tdf#93868: PPTX import: Incorrect inheritance of shape fill properties
DrawingML: The useBgFill attribute specifies that the shape fill should be set to that of the slide background. Reviewed-on: https://gerrit.libreoffice.org/23039 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit f3d1ac75c4b7fa63022e54a9cbff46ba99535076) Change-Id: I8b568e730f00326d51e7b604579f4ff990b26f8a
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx9
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx3
-rw-r--r--oox/source/ppt/slidepersist.cxx3
3 files changed, 6 insertions, 9 deletions
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 3b3d20cfc649..d02acabc849a 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -98,11 +98,10 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken
std::shared_ptr<PPTShape> pShape( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) );
if( rAttribs.getBool( XML_useBgFill, false ) )
{
- ::oox::drawingml::FillProperties &aFill = pShape->getFillProperties();
- aFill.moFillType = XML_solidFill;
- // This is supposed to fill with slide (background) color, but
- // TODO: We are using white here, because thats the closest we can assume (?)
- aFill.maFillColor.setSrgbClr( API_RGB_WHITE );
+ const oox::drawingml::FillPropertiesPtr pBackgroundPropertiesPtr = mpSlidePersistPtr->getBackgroundProperties();
+ if ( pBackgroundPropertiesPtr ) {
+ pShape->getFillProperties().assignUsed( *pBackgroundPropertiesPtr );
+ }
}
pShape->setModelId(rAttribs.getString( XML_modelId ).get());
return new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape );
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 2d75afc529fb..d8c4735e2eec 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -166,9 +166,8 @@ SlideFragmentHandler::~SlideFragmentHandler()
if( mpSlidePersistPtr->getTheme() )
pFillProperties = mpSlidePersistPtr->getTheme()->getFillStyle( rAttribs.getInteger( XML_idx, -1 ) );
FillPropertiesPtr pFillPropertiesPtr( pFillProperties ? new FillProperties( *pFillProperties ) : new FillProperties() );
- ContextHandlerRef ret = new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() );
mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
- return ret;
+ return this;
}
break;
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index d6e3f9929232..f5278688b27f 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -166,8 +166,7 @@ void SlidePersist::createBackground( const XmlFilterBase& rFilterBase )
{
if ( mpBackgroundPropertiesPtr )
{
- sal_Int32 nPhClr = maBackgroundColor.isUsed() ?
- maBackgroundColor.getColor( rFilterBase.getGraphicHelper() ) : API_RGB_TRANSPARENT;
+ sal_Int32 nPhClr = mpBackgroundPropertiesPtr->getBestSolidColor().getColor( rFilterBase.getGraphicHelper() );
::oox::drawingml::ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() );
mpBackgroundPropertiesPtr->pushToPropMap( aPropMap, rFilterBase.getGraphicHelper(), 0, nPhClr );