summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-01-06 16:55:22 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-01-06 16:43:41 +0000
commit59339dec1ce56213dc74a06af2f0d35ac1c534d7 (patch)
tree6bd09e1e426ad21ec1bb893ab2a6d4dc4510f208 /oox
parentac561ab34ea9d26243fe3791f624c440dcf7ae6d (diff)
tdf#105150 PPTX import: try harder to handle <p:sp useBgFill="1">
The bugdoc has two shapes. The red rectangle is supposed to be covered by the other shape, but it wasn't as the fill style was set to none. The reason for that was we ignored useBgFill, unless the slide had an explicit fill style. Assume that in that case a white solid fill is the default. Change-Id: Iea20e216e44e13db68887f285c10bc1a8feacf0a Reviewed-on: https://gerrit.libreoffice.org/32786 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 57f0f9127a0a..5208bd49e33e 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -101,7 +101,15 @@ 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 ) )
{
- const oox::drawingml::FillPropertiesPtr pBackgroundPropertiesPtr = mpSlidePersistPtr->getBackgroundProperties();
+ oox::drawingml::FillPropertiesPtr pBackgroundPropertiesPtr = mpSlidePersistPtr->getBackgroundProperties();
+ if (!pBackgroundPropertiesPtr)
+ {
+ // The shape wants a background, but the slide doesn't have
+ // one: default to white.
+ pBackgroundPropertiesPtr.reset(new oox::drawingml::FillProperties());
+ pBackgroundPropertiesPtr->moFillType = XML_solidFill;
+ pBackgroundPropertiesPtr->maFillColor.setSrgbClr(0xFFFFFF);
+ }
if ( pBackgroundPropertiesPtr ) {
pShape->getFillProperties().assignUsed( *pBackgroundPropertiesPtr );
}