oox/source/export/drawingml.cxx        |    3 ++-
 sc/qa/unit/data/xlsx/tdf91332.xlsx     |binary
 sc/qa/unit/subsequent_export_test2.cxx |   19 +++++++++++++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 2ef83c8782ed947b47f9292a12355fc3bb078078
Author:     Tünde Tóth <toth.tu...@nisz.hu>
AuthorDate: Wed Apr 19 14:48:33 2023 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Tue Apr 25 15:04:09 2023 +0200

    tdf#91332 XLSX export: fix missing solidFill
    
    Background color of shape inherited from theme
    lost after export.
    
    Regression from commit bc0a9076aa43a0782bcf81e55d3f84f6af0f68e8
    "ooxml: Preserve shape theme attribute for solid fill".
    
    Change-Id: I2d8298ac17332ba3ad6a627ce8b07c23087ac7b1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150674
    Tested-by: Jenkins
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 60a5cdd62d7e..77c4c1b02186 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -530,7 +530,8 @@ void DrawingML::WriteSolidFill( const Reference< 
XPropertySet >& rXPropSet )
             WriteSolidFill(::Color(ColorTransparency, nFillColor & 0xffffff), 
nAlpha);
         }
     }
-    else if ( !sColorFillScheme.isEmpty() )
+    // tdf#91332 LO doesn't export the actual theme.xml in XLSX.
+    else if ( !sColorFillScheme.isEmpty() && GetDocumentType() != 
DOCUMENT_XLSX )
     {
         // the shape had a scheme color and the user didn't change it
         WriteSolidFill( sColorFillScheme, aTransformations, nAlpha );
diff --git a/sc/qa/unit/data/xlsx/tdf91332.xlsx 
b/sc/qa/unit/data/xlsx/tdf91332.xlsx
new file mode 100644
index 000000000000..5f1d119e8ee7
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf91332.xlsx differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 7a9579f3dfa0..403bffc3112f 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -1224,6 +1224,25 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf126024XLSX)
     assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", 
"TargetMode", "External");
 }
 
+CPPUNIT_TEST_FIXTURE(ScExportTest2, testTdf91332)
+{
+    createScDoc("xlsx/tdf91332.xlsx");
+    saveAndReload("Calc Office Open XML");
+
+    uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
+    uno::Reference<drawing::XDrawPage> 
xPage(xDoc->getDrawPages()->getByIndex(0),
+                                             uno::UNO_QUERY_THROW);
+    uno::Reference<beans::XPropertySet> xShapeProps(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: rgba[90cf47ff]
+    // - Actual  : rgba[ffffffff]
+    // i.e. fill color inherited from theme lost after export.
+    Color nColor;
+    xShapeProps->getPropertyValue("FillColor") >>= nColor;
+    CPPUNIT_ASSERT_EQUAL(Color(0x90cf47), nColor);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to