diff --git a/sw/qa/extras/ooxmlexport/data/fdo76979.docx b/sw/qa/extras/ooxmlexport/data/fdo76979.docx new file mode 100644 index 000000000000..f8ee9952007c Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo76979.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 417e92c5e544..535ee1a49529 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1000,6 +1000,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo76249, "fdo76249.docx") assertXPath(pXmlDoc, "//mc:Choice/w:drawing//w:txbxContent//w:drawing//lc:lockedCanvas", 1); } +DECLARE_OOXMLEXPORT_TEST(testFdo76979, "fdo76979.docx") +{ + // The problem was that black was exported as "auto" fill color, resulting in well-formed, but invalid XML. + xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); + if (!pXmlDoc) + return; + // This was "auto", not "FFFFFF". + assertXPath(pXmlDoc, "//wps:spPr/a:solidFill/a:srgbClr", "val", "FFFFFF"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index caea79eded52..947cd16d1766 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6528,7 +6528,7 @@ boost::optional lcl_getDmlAlpha(const SvxBrushItem& rBrush) void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) { - OString sColor = msfilter::util::ConvertColor( rBrush.GetColor( ) ); + OString sColor = msfilter::util::ConvertColor( rBrush.GetColor().GetRGBColor() ); boost::optional oAlpha = lcl_getDmlAlpha(rBrush); if (m_rExport.SdrExporter().getTextFrameSyntax()) {