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

Mark Hung marklh9 at gmail.com
Wed Jan 27 05:36:16 PST 2016


 dev/null                                               |binary
 sw/qa/extras/ooxmlexport/data/outline-number-types.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx               |   27 +++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx           |   34 ++++++++++++++++-
 4 files changed, 59 insertions(+), 2 deletions(-)

New commits:
commit 91b926d4b9939337f54d6c9f0b940b161dc3437f
Author: Mark Hung <marklh9 at gmail.com>
Date:   Sun Jan 24 16:36:05 2016 +0800

    tdf#84317 convert missing numbering types to OOXML tokens.
    
    CIRCLE_NUMBER -> decimalEnclosedCircle
    CHARS_ARABIC --> arabicAlpha
    CHARS_THAI --> thaiLetter
    CHARS_PERSIAN --> hindiVowels
    NUMBER_NONE --> none
    All the reset --> decimal
    
    All the types above were converted to 'none' before.
    
    Change-Id: Ie97e3fd4a00b7e4cc80ffb3776028e431e0535de
    Reviewed-on: https://gerrit.libreoffice.org/21741
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/ooxmlexport/data/outline-num-none.odt b/sw/qa/extras/ooxmlexport/data/outline-num-none.odt
deleted file mode 100644
index b3bb56d..0000000
Binary files a/sw/qa/extras/ooxmlexport/data/outline-num-none.odt and /dev/null differ
diff --git a/sw/qa/extras/ooxmlexport/data/outline-number-types.odt b/sw/qa/extras/ooxmlexport/data/outline-number-types.odt
new file mode 100644
index 0000000..2232ad6
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/outline-number-types.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 239cfe8..989c79e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -634,10 +634,35 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlNumListZHCN, "numlist-zhcn.odt")
     assertXPath ( pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt","val","chineseCountingThousand" );
 }
 
-DECLARE_OOXMLEXPORT_TEST(testOOxmlOutlineNumNone, "outline-num-none.odt")
+DECLARE_OOXMLEXPORT_TEST(testOOxmlOutlineNumberTypes, "outline-number-types.odt")
 {
     if (xmlDocPtr pXmlDoc = parseExport("word/numbering.xml"))
+    {
         assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[1]/w:numFmt", "val", "none");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[2]/w:numFmt", "val", "decimalEnclosedCircle");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[3]/w:numFmt", "val", "decimal"); // CHARS_GREEK_UPPER_LETTER fallback to decimal
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[4]/w:numFmt", "val", "decimal"); // CHARS_GREEK_LOWER_LETTER fallback to decimal
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[5]/w:numFmt", "val", "arabicAlpha");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[6]/w:numFmt", "val", "hindiVowels");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[1]/w:lvl[7]/w:numFmt", "val", "thaiLetters");
+
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[1]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[2]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[3]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[4]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[5]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[6]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[7]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[2]/w:lvl[8]/w:numFmt", "val", "decimal");
+
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[1]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[2]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[3]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[4]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[5]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[6]/w:numFmt", "val", "decimal");
+        assertXPath(pXmlDoc, "/w:numbering/w:abstractNum[3]/w:lvl[7]/w:numFmt", "val", "decimal");
+    }
 }
 
 DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 138b806..1586054 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5644,6 +5644,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
         case style::NumberingType::BITMAP:
         case style::NumberingType::CHAR_SPECIAL:
         case style::NumberingType::CHARS_HEBREW:
+        case style::NumberingType::NUMBER_NONE:
             return impl_NumberingType( nNumberingType );
         case style::NumberingType::FULLWIDTH_ARABIC: aType="decimalFullWidth"; break;
         case style::NumberingType::TIAN_GAN_ZH: aType="ideographTraditional"; break;
@@ -5670,8 +5671,39 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
         case style::NumberingType::HANGUL_JAMO_KO: aType="chosung";break;
         case style::NumberingType::NUMBER_HANGUL_KO: aType="koreanDigital";break;
         case style::NumberingType::NUMBER_UPPER_KO: aType="koreanLegal"; break;
+        case style::NumberingType::CIRCLE_NUMBER: aType="decimalEnclosedCircle"; break;
+        case style::NumberingType::CHARS_ARABIC: aType="arabicAlpha"; break;
+        case style::NumberingType::CHARS_THAI: aType="thaiLetters"; break;
+        case style::NumberingType::CHARS_PERSIAN: aType="hindiVowels"; break;
+/*
+        Fallback the rest to decimal.
+        case style::NumberingType::NATIVE_NUMBERING:
+        case style::NumberingType::HANGUL_CIRCLED_JAMO_KO:
+        case style::NumberingType::HANGUL_CIRCLED_SYLLABLE_KO:
+        case style::NumberingType::CHARS_GREEK_UPPER_LETTER:
+        case style::NumberingType::CHARS_GREEK_LOWER_LETTER:
+        case style::NumberingType::PAGE_DESCRIPTOR:
+        case style::NumberingType::TRANSLITERATION:
+        case style::NumberingType::CHARS_NEPALI:
+        case style::NumberingType::CHARS_KHMER:
+        case style::NumberingType::CHARS_LAO:
+        case style::NumberingType::CHARS_TIBETAN:
+        case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_BG:
+        case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_BG:
+        case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_N_BG:
+        case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_N_BG:
+        case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_RU:
+        case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_RU:
+        case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_N_RU:
+        case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_N_RU:
+        case style::NumberingType::CHARS_MYANMAR:
+        case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_SR:
+        case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_SR:
+        case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_N_SR:
+        case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_N_SR:
+*/
         default:
-            aType = "none";        break;
+            aType = "decimal";        break;
     }
     return aType;
 }


More information about the Libreoffice-commits mailing list