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

Pallavi Jadhav pallavi.jadhav at synerzip.com
Thu Apr 3 02:09:39 PDT 2014


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

New commits:
commit 8902a25c1ad11161fe7b9d263e9d7afe23f95e50
Author: Pallavi Jadhav <pallavi.jadhav at synerzip.com>
Date:   Thu Mar 27 14:55:16 2014 +0530

    fdo#76589 : FILESAVE: DOCX: Numbered list is not preserved after RT
    
    	Issue :
    	Numbered list without suffix does not get preserved after
    	Roudtrip.
    
    	Description :
    	- For level zero LO was writing w:lvlText with epmty value.
    	- This was because in DocxAttributeOutput::NumberingLevel()
    	  check was based on empty NumberingString.
    	- But for "deciaml" also rNumberingString appears to be empty
    	  for level-0
    
    	Implementation :
    	- Added check to write empty value for w:lvlText only if
    	  NumberingType is "bullet" with level-0.
    	- This will not write empty w:lvlText with level-0 and
    	  NumberingType as "decimal".
    
    Reviewed on:
    	https://gerrit.libreoffice.org/8768
    
    Change-Id: Ic6ece45e0122da05013beac93a6e11fac926514d

diff --git a/sw/qa/extras/ooxmlexport/data/fdo76589.docx b/sw/qa/extras/ooxmlexport/data/fdo76589.docx
new file mode 100644
index 0000000..d501b1b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo76589.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 15a5ddf..b68b872 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2991,6 +2991,20 @@ DECLARE_OOXMLEXPORT_TEST(test76317_2K10, "test76317_2K10.docx")
     assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]/a:avLst[1]/a:gd[1]", "name", "adj");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testfdo76589 , "fdo76589.docx")
+{
+    /* Numbered list was not preserve after RT.
+     * In numbering.xml, when NumberingType is "decimal" and level is zero,
+     * w:val of w:lvlText was empty.
+     * It should be <w:lvlText w:val="%1" />
+     */
+    xmlDocPtr pXmlDoc = parseExport("word/numbering.xml");
+    if (!pXmlDoc)
+        return;
+
+    assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:lvlText","val","%1" );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testAuthorPropertySdt, "author-property.docx")
 {
     xmlDocPtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index dd8ee93..caea79e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5006,7 +5006,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
         aBuffer.append( pPrev, pIt - pPrev );
 
     // If bullet char is empty, set lvlText as empty
-    if ( aText.equals ( OUString(sal_Unicode(0)) ) )
+    if ( aText.equals ( OUString(sal_Unicode(0)) ) && nNumberingType == SVX_NUM_CHAR_SPECIAL )
     {
         m_pSerializer->singleElementNS( XML_w, XML_lvlText, FSNS( XML_w, XML_val ), "", FSEND );
     }


More information about the Libreoffice-commits mailing list