From 232251e11aecf051bc0e2a915e5af6c0d3650469 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Thu, 25 Jan 2018 18:32:53 +0100 Subject: tdf#107608: PPTX: Import pattern fill background color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic7e9dc314c961605fc8467eebd465fa286993e17 Reviewed-on: https://gerrit.libreoffice.org/48633 Tested-by: Jenkins Reviewed-by: Tamás Zolnai --- oox/source/drawingml/fillproperties.cxx | 9 +++++++-- oox/source/drawingml/shapepropertymap.cxx | 3 ++- oox/source/token/properties.txt | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 3d81ec94c71c..d2d2775a3e3d 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -673,10 +673,15 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, Color aColor( maPatternProps.maPattFgColor ); if( aColor.isUsed() && maPatternProps.moPattPreset.has() ) { - // we do not support hatches that have background - // color too, so all this is some best-effort approach eFillStyle = FillStyle_HATCH; rPropMap.setProperty( ShapeProperty::FillHatch, createHatch( maPatternProps.moPattPreset.get(), aColor.getColor( rGraphicHelper, nPhClr ) ) ); + + // Set background color for hatch + if(maPatternProps.maPattBgColor.isUsed()) + { + rPropMap.setProperty( ShapeProperty::FillBackground, true ); + rPropMap.setProperty( ShapeProperty::FillColor, maPatternProps.maPattBgColor.getColor( rGraphicHelper, nPhClr ) ); + } } else if ( maPatternProps.maPattBgColor.isUsed() ) { diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx index 6f71873df362..b1cf0239237e 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -45,7 +45,8 @@ static const ShapePropertyIds spnDefaultShapeIds = PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, PROP_FillHatch, PROP_ShadowXDistance, - PROP_FillBitmapName + PROP_FillBitmapName, + PROP_FillBackground }; } // namespace diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index e6bc79ff3d08..caab75eae4d4 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -158,6 +158,7 @@ ExternalLinks ExtrapolateBackward ExtrapolateForward FileFormat +FillBackground FillBitmapMode FillBitmapName FillBitmapPositionOffsetX -- cgit