From bb1e68c72e2c95855bde54cd9eb592d0bd3dc4c6 Mon Sep 17 00:00:00 2001 From: Tünde Tóth Date: Thu, 1 Jun 2023 15:25:45 +0200 Subject: tdf#145651 Chart OOXML export: fix write error in exportSolidFill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't export the background color, if the FillColor property is empty. Steps to reproduce: 1. E.g. in Impress, insert a chart (Insert > Chart...). 2. In chart editing mode, select the legend, use the "sidebar > Area > Fill" and change from "none" to "color". Notice how the default blue that is used does not correspond to the colour in the colour picker right underneath. 3. Save as > OOXML format. Change-Id: I33a060d8fc6c49708029008393e2e22e3d5335b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152951 Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit 5a4f32ebc037964b7d00a468bc7761e078baeecc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153332 Tested-by: Jenkins --- oox/source/export/chartexport.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'oox') diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 29f25b82b944..f0a301f79136 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1889,9 +1889,9 @@ void ChartExport::exportSolidFill(const Reference< XPropertySet >& xPropSet) // Similar to DrawingML::WriteSolidFill, but gradient access via name // and currently no InteropGrabBag // get fill color - if (!GetProperty( xPropSet, "FillColor" )) + sal_uInt32 nFillColor = 0; + if (!GetProperty(xPropSet, "FillColor") || !(mAny >>= nFillColor)) return; - sal_uInt32 nFillColor = mAny.get(); sal_Int32 nAlpha = MAX_PERCENT; if (GetProperty( xPropSet, "FillTransparence" )) -- cgit