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

Rajashri rajashri.udhoji at synerzip.com
Fri Apr 18 02:15:39 PDT 2014


 sw/qa/extras/ooxmlexport/data/NumberedList.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx        |   15 +++++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx    |    2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit a7f68538f5f27093b8165e2e8fce3f7fade3aaf9
Author: Rajashri <rajashri.udhoji at synerzip.com>
Date:   Fri Jan 31 15:08:11 2014 +0530

    fdo#74150:Numbered list getting display after RT -table-within-table-1.docx
    
    Description:
    For pStyle = 'NumberedList1', iLvl and numId was not preserved.
    These tags needs to be preserved under numPr in document.xml
    These tags are preserved  now.
    
    Conflicts:
    
    	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
    
    Change-Id: Ib6734c9ae55bd72d4fbc0f6d6cae85764ac1a244
    Reviewed-on: https://gerrit.libreoffice.org/7767
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/data/NumberedList.docx b/sw/qa/extras/ooxmlexport/data/NumberedList.docx
new file mode 100644
index 0000000..53f4490
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/NumberedList.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index e7f57e6..a7ad9b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3129,6 +3129,21 @@ DECLARE_OOXMLEXPORT_TEST(test77219, "test77219.docx")
     assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", "1");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testNumberedList,"NumberedList.docx")
+{
+    //fdo74150:In document.xml, for pStyle = "NumberedList1", iLvl and numId was not preserved
+    xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+    if (!pXmlDoc)
+        return;
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:pStyle", "val", "NumberedList1");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:ilvl","val", "0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p[1]/w:pPr[1]/w:numPr/w:numId","val", "0");
+
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:pStyle","val", "NumberedList1");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:ilvl","val", "0");
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[3]/w:pPr[1]/w:numPr/w:numId","val", "0");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testFDO76597, "fdo76597.docx")
 {
     // check XML
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 3de5f8b..a4679f7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6106,7 +6106,7 @@ void DocxAttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone )
 
 void DocxAttributeOutput::ParaNumRule_Impl( const SwTxtNode* /*pTxtNd*/, sal_Int32 nLvl, sal_Int32 nNumId )
 {
-    if ( USHRT_MAX != nNumId && 0 != nNumId )
+    if ( USHRT_MAX != nNumId )
     {
         m_pSerializer->startElementNS( XML_w, XML_numPr, FSEND );
         m_pSerializer->singleElementNS( XML_w, XML_ilvl, FSNS( XML_w, XML_val ), OString::number( nLvl).getStr(), FSEND );


More information about the Libreoffice-commits mailing list