diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-04-03 13:35:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-04-03 14:01:03 +0200 |
commit | 84c04d73e6f80120c2fc7d17dd12e3b68214a63b (patch) | |
tree | 43212bef2733aa6ffd6b7d7d7243a9bcc7b567df /sw/qa | |
parent | 5babf1b9037eb283798322eecd8334e6ff1db655 (diff) |
fdo#76979 DOCX export: a:srgbClr should be always an explicit color
The brush color contains both the color itself and transparency as well.
In case of DocxAttributeOutput::FormatBackground(), the sColor should
contain the color part, and oAlpha the transparency part.
In case of drawingML export of Writer TextFrames, an automatic color
(0xFFFFFFF) shouldn't be recognized as "auto", as that's invalid:
instead an explicit 0xFFFFFF with zero transparency should be written.
Fix the problem by calling msfilter::util::ConvertColor() for the RGB
color only.
Change-Id: I2132375a4dbcac1667aed49c74e581183178b0cc
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo76979.docx | bin | 0 -> 41973 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 10 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo76979.docx b/sw/qa/extras/ooxmlexport/data/fdo76979.docx Binary files differnew file mode 100644 index 000000000000..f8ee9952007c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76979.docx 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(); |