[Libreoffice-commits] core.git: oox/source

geri1245 g.tarsoly at yahoo.com
Mon Dec 11 19:32:47 UTC 2017


 oox/source/export/drawingml.cxx |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 54dfb9ff07a41d9249302ac2ed0a005d0a8114d4
Author: geri1245 <g.tarsoly at yahoo.com>
Date:   Wed Dec 6 19:40:59 2017 +0100

    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 at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

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 );


More information about the Libreoffice-commits mailing list