summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorgeri1245 <g.tarsoly@yahoo.com>2017-12-06 19:40:59 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-12-11 20:30:24 +0100
commit54dfb9ff07a41d9249302ac2ed0a005d0a8114d4 (patch)
tree3623549b3710448ee6e5afcd056b7cfc33f4c87e /oox
parent9db88abe3f91bb4f7b1cbf533a40af4eb8266c21 (diff)
tdf#111785 Save hatch background color in pptx format.
When exporting to pptx from LO, the background color of the hatching is preserved. The default background, when no hatch background is set is transparent. Change-Id: Ie44c89a9ce54eef49100b3e7b376c27c1a952fcf Reviewed-on: https://gerrit.libreoffice.org/46098 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 1ec05fa2a2e9..eb19a286e587 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1189,9 +1189,26 @@ void DrawingML::WritePattFill( const Reference< XPropertySet >& rXPropSet )
WriteColor(aHatch.Color);
mpFS->endElementNS( XML_a , XML_fgClr );
- // In Writer hatching has no background so use white as a default value.
+ sal_uInt32 nColor = COL_WHITE;
+ sal_Int32 nAlpha = 0;
+ bool isBackgroundFilled = false;
+
+ if ( GetProperty( rXPropSet, "FillBackground" ) )
+ {
+ mAny >>= isBackgroundFilled;
+ if( isBackgroundFilled )
+ {
+ nAlpha = MAX_PERCENT;
+
+ if( GetProperty( rXPropSet, "FillColor" ) )
+ {
+ mAny >>= nColor;
+ }
+ }
+ }
+
mpFS->startElementNS( XML_a , XML_bgClr, FSEND );
- WriteColor(COL_WHITE);
+ WriteColor(nColor, nAlpha);
mpFS->endElementNS( XML_a , XML_bgClr );
mpFS->endElementNS( XML_a , XML_pattFill );