[Libreoffice-commits] core.git: sw/qa sw/source

umeshkadam umesh.kadam at synerzip.com
Fri May 9 05:08:45 PDT 2014


 sw/qa/extras/ooxmlexport/data/FDO78292.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx     |    9 +++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx |    3 ++-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 273e73c8963e0ce4d52e938cedafa9041144d4e5
Author: umeshkadam <umesh.kadam at synerzip.com>
Date:   Wed May 7 18:56:10 2014 +0530

    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 at igalia.com>
    Tested-by: Jacobo Aragunde Pérez <jaragunde at igalia.com>

diff --git a/sw/qa/extras/ooxmlexport/data/FDO78292.docx b/sw/qa/extras/ooxmlexport/data/FDO78292.docx
new file mode 100644
index 0000000..0388c0a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/FDO78292.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 4f0a329..6564776 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 553b444..4f29904 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


More information about the Libreoffice-commits mailing list