summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-01-25 18:32:53 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-01-26 12:28:46 +0100
commit232251e11aecf051bc0e2a915e5af6c0d3650469 (patch)
treef22cf0f42e8a5862a3f194cd52201865a7a7a3cb /oox
parentd999b55e28d0445df870f69b3a269964e3635def (diff)
tdf#107608: PPTX: Import pattern fill background color
Change-Id: Ic7e9dc314c961605fc8467eebd465fa286993e17 Reviewed-on: https://gerrit.libreoffice.org/48633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/fillproperties.cxx9
-rw-r--r--oox/source/drawingml/shapepropertymap.cxx3
-rw-r--r--oox/source/token/properties.txt1
3 files changed, 10 insertions, 3 deletions
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