diff options
author | Pallavi Jadhav <pallavi.jadhav@synerzip.com> | 2014-03-27 14:55:16 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-04-03 11:08:56 +0200 |
commit | 8902a25c1ad11161fe7b9d263e9d7afe23f95e50 (patch) | |
tree | 91f6034b9475bf7b041d074032828a239187f409 /sw | |
parent | 6055c6670ff592923c3526515cb53eca2244d7a7 (diff) |
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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo76589.docx | bin | 0 -> 13790 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo76589.docx b/sw/qa/extras/ooxmlexport/data/fdo76589.docx Binary files differnew file mode 100644 index 000000000000..d501b1b59400 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76589.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 15a5ddf859ab..b68b8722be16 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 dd8ee9357547..caea79eded52 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 ); } |