summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2023-04-19 14:48:33 +0200
committerLászló Németh <nemeth@numbertext.org>2023-04-25 15:04:09 +0200
commit2ef83c8782ed947b47f9292a12355fc3bb078078 (patch)
treedfe58eb982045d78b07abbe50ffe5938649361bf
parenttdf#119565 XLSX export: fix lost line properties inherited from theme (diff)
downloadcore-2ef83c8782ed947b47f9292a12355fc3bb078078.tar.gz
core-2ef83c8782ed947b47f9292a12355fc3bb078078.zip
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 <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--oox/source/export/drawingml.cxx3
-rw-r--r--sc/qa/unit/data/xlsx/tdf91332.xlsxbin0 -> 11375 bytes
-rw-r--r--sc/qa/unit/subsequent_export_test2.cxx19
3 files changed, 21 insertions, 1 deletions
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
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf91332.xlsx
Binary files 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: */