diff options
-rw-r--r-- | oox/source/drawingml/textcharacterpropertiescontext.cxx | 7 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx | bin | 0 -> 16784 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 14 |
3 files changed, 21 insertions, 0 deletions
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 8c6eb4aee22a..8fecb8bd2735 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -201,6 +201,13 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl mrTextCharacterProperties.moUnderline = XML_dash; else if (attrib == "none") mrTextCharacterProperties.moUnderline = XML_none; + auto colorAttrib = rAttribs.getIntegerHex(W_TOKEN(color)); + if (colorAttrib.has()) + { + oox::drawingml::Color theColor; + theColor.setSrgbClr(colorAttrib.get()); + mrTextCharacterProperties.maUnderlineColor = theColor; + } break; } case W_TOKEN( spacing ): diff --git a/sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx b/sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx Binary files differnew file mode 100644 index 000000000000..aa5528b31093 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf132491_UnderlineColorGroupedShapes.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index e73e7dcfddab..a6352c767335 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -1198,6 +1198,20 @@ DECLARE_OOXMLEXPORT_TEST(testUnderlineGroupShapeText, "tdf123351_UnderlineGroupS "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "val", "single"); } +DECLARE_OOXMLEXPORT_TEST(testUnderlineColorGroupedShapes, "tdf132491_UnderlineColorGroupedShapes.docx") +{ + // tdf#132491 : Check if correct color is used for underline. + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "FF0000"); + assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[2]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color", "00B050"); + assertXPathNoAttribute(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/a:graphic/a:graphicData/wpg:wgp/wps:wsp[3]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:u", "color"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |