diff options
-rw-r--r-- | oox/source/drawingml/textcharacterpropertiescontext.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx | bin | 16313 -> 42520 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 28 |
3 files changed, 28 insertions, 6 deletions
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index cd98b9564825..4533a96e1cca 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -211,10 +211,12 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl case W_TOKEN( bCs ): break; case W_TOKEN( strike ): - mrTextCharacterProperties.moStrikeout = XML_sngStrike; + if (rAttribs.getBool(W_TOKEN(val), true)) + mrTextCharacterProperties.moStrikeout = XML_sngStrike; break; case W_TOKEN( dstrike ): - mrTextCharacterProperties.moStrikeout = XML_dblStrike; + if (rAttribs.getBool(W_TOKEN(val), true)) + mrTextCharacterProperties.moStrikeout = XML_dblStrike; break; case W_TOKEN( color ): if (rAttribs.getInteger(W_TOKEN(val)).has()) diff --git a/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx b/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx Binary files differindex b464f35e2f7e..3fd4ab1f5f59 100644 --- a/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index e88b902aee0a..ba54c33e115a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -780,17 +780,37 @@ DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupS if (!pXml) return; - // double strike + // double strike (dstrike) + // no "val" attribute assertXPath(pXml, "/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:dstrike"); assertXPathNoAttribute(pXml, "/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:dstrike", "val"); + // "val" attribute is true, this is used in this test file. However, LO is going to export this element without the "val" attribute + // because if the element appears, but without an attribute its "val" true by default. + assertXPath(pXml, "/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:dstrike"); + assertXPathNoAttribute(pXml, "/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:dstrike", "val"); + // "val" attribute is false (this was missing, resulting the regression) + assertXPath(pXml, "/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:dstrike", "val", "false"); - // simple strike + // simple strike (strike) + // no "val" attribute assertXPath(pXml, "/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:strike"); + "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"); assertXPathNoAttribute(pXml, "/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:strike", "val"); + "wps:wsp[4]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val"); + // "val" attribute is true, this is used in this test file. However, LO is going to export this element without the "val" attribute + // because if the element appears, but without an attribute its "val" true by default. + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike"); + assertXPathNoAttribute(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[5]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val"); + // "val" attribute is false + assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wpg:wgp/" + "wps:wsp[6]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:strike", "val", "false"); } CPPUNIT_PLUGIN_IMPLEMENT(); |