[Libreoffice-commits] core.git: oox/source sw/qa
Regényi Balázs (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 3 12:35:28 UTC 2020
oox/source/drawingml/textcharacterpropertiescontext.cxx | 6 +++
sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 20 ++++++++++
3 files changed, 26 insertions(+)
New commits:
commit 143e6641cea7a06faeec8b3b65aa09b153a6490f
Author: Regényi Balázs <regenyi.balazs+gerrit at gmail.com>
AuthorDate: Thu Apr 2 10:56:08 2020 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Fri Apr 3 14:34:48 2020 +0200
tdf#131776 DOCX DrawingML shape import: fix missing strikeout
The absence of simple and double strikeouts is fixed.
Co-Author: Szabolcs Toth
Co-Author: Tibor Nagy
Change-Id: I5d7eef660f87c67855bce9847ad8e07d074183e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91555
Tested-by: Jenkins
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index b7bb876044cf..cd98b9564825 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -210,6 +210,12 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
break;
case W_TOKEN( bCs ):
break;
+ case W_TOKEN( strike ):
+ mrTextCharacterProperties.moStrikeout = XML_sngStrike;
+ break;
+ case W_TOKEN( dstrike ):
+ 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
new file mode 100644
index 000000000000..b464f35e2f7e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131776_StrikeoutGroupShapeText.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index cff728463f28..fafe1cfe2b02 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -759,6 +759,26 @@ DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt")
assertXPath(pXmlStyles, "/w:styles/w:docDefaults/w:pPrDefault/w:pPr/w:suppressAutoHyphens", "val", "true");
}
+DECLARE_OOXMLEXPORT_TEST(testStrikeoutGroupShapeText, "tdf131776_StrikeoutGroupShapeText.docx")
+{
+ // tdf#131776: Check if strikeout is used in shape group texts
+ xmlDocPtr pXml = parseExport("word/document.xml");
+ if (!pXml)
+ return;
+
+ // double strike
+ 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");
+
+ // simple strike
+ 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");
+ 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");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list