summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorumeshkadam <umesh.kadam@synerzip.com>2014-05-07 18:56:10 +0530
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-05-09 12:08:17 +0000
commit273e73c8963e0ce4d52e938cedafa9041144d4e5 (patch)
tree1a769e807f46256db51a97167e6fe43157cd258a
parent6651a2493d72f2bd0613b96ee5276a1270709630 (diff)
fdo#78292: Tags related to checkbox r being written in text tag for sdt cntnt.
- The parent node for checked, checkedState, uncheckedState is getting overwritten by "text" - text node is a leaf node, and should not have any children. Change-Id: Ic269525001e914adc1aa328c92be5fe4d5d1b3e7 Reviewed-on: https://gerrit.libreoffice.org/9278 Reviewed-by: Jacobo Aragunde Pérez <jaragunde@igalia.com> Tested-by: Jacobo Aragunde Pérez <jaragunde@igalia.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/FDO78292.docxbin0 -> 586141 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx3
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/FDO78292.docx b/sw/qa/extras/ooxmlexport/data/FDO78292.docx
new file mode 100644
index 000000000000..0388c0a5df2b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/FDO78292.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 4f0a3290e102..65647768a5b1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3025,6 +3025,15 @@ DECLARE_OOXMLEXPORT_TEST(testTCTagMisMatch, "TCTagMisMatch.docx")
assertXPath(pXmlDoc,"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]", 1);
}
+DECLARE_OOXMLEXPORT_TEST(testFDO78292, "FDO78292.docx")
+{
+ //text node is a leaf node, it should not have any children
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if(!pXmlDoc)
+ return;
+ assertXPath(pXmlDoc,"/w:document/w:body/w:p[14]/w:sdt[3]/w:sdtPr[1]/w:text/w14:checked",0);
+}
+
DECLARE_OOXMLEXPORT_TEST(testHyperLinkTagEnded, "fdo76316.docx")
{
/* XML tag <w:hyperlink> was not getting closed when its inside another
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 553b444434d6..4f299049c235 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7325,7 +7325,8 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
rtl::OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_text")
+ //do not overwrite the parent node.
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_text" && !m_pRunSdtPrTokenChildren)
m_nRunSdtPrToken = FSNS( XML_w, XML_text );
else if (aPropertyValue.Name == "ooxml:CT_SdtPr_id" && m_nRunSdtPrToken == 0)
// only write id token as a marker if no other exist