[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/qa sw/source writerfilter/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 2 10:57:53 UTC 2020


 sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx               |   13 +++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx             |    1 +
 writerfilter/source/dmapper/ConversionHelper.cxx         |    4 +++-
 4 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 5c397440529bbfd997a3fd75f64c4e4e78fc80ac
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Mar 4 09:13:11 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Apr 2 12:57:21 2020 +0200

    sw padded numbering: add DOCX filter
    
    DOCX uses <w:numFmt w:val="decimalZero"/> for this.
    
    (cherry picked from commit 5435ea2afc5da5633a440f2f06d79265bcbb040c)
    
    Conflicts:
            sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
            writerfilter/source/dmapper/ConversionHelper.cxx
    
    Change-Id: I12a4a88f472af42a04244d30f9e59fc0b8b4855c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91503
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx b/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx
new file mode 100644
index 000000000000..f87dce364c9e
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/arabic-zero-numbering.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 9dcc609fcf6a..073844d6c75d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -425,6 +425,19 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-
     }
 }
 
+DECLARE_OOXMLEXPORT_TEST(testArabicZeroNumbering, "arabic-zero-numbering.docx")
+{
+    auto xNumberingRules
+        = getProperty<uno::Reference<container::XIndexAccess>>(getParagraph(1), "NumberingRules");
+    comphelper::SequenceAsHashMap aMap(xNumberingRules->getByIndex(0));
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 64
+    // - Actual  : 4
+    // i.e. numbering type was ARABIC, not ARABIC_ZERO.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(style::NumberingType::ARABIC_ZERO),
+                         aMap["NumberingType"].get<sal_uInt16>());
+}
+
 CPPUNIT_TEST_FIXTURE(SwModelTestBase, testZeroLineSpacing)
 {
     // Create the doc model.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f75d4aa0d02d..02c6b8f370d0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6491,6 +6491,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
         case style::NumberingType::TEXT_CARDINAL: aType="cardinalText"; break;
         case style::NumberingType::TEXT_ORDINAL: aType="ordinalText"; break;
         case style::NumberingType::SYMBOL_CHICAGO: aType="chicago"; break;
+        case style::NumberingType::ARABIC_ZERO: aType = "decimalZero"; break;
 /*
         Fallback the rest to decimal.
         case style::NumberingType::NATIVE_NUMBERING:
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 996c284f1779..c0eaf005d4dd 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -585,6 +585,9 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
         case NS_ooxml::LN_Value_ST_NumberFormat_chicago:
             nRet = style::NumberingType::SYMBOL_CHICAGO;
             break;
+        case NS_ooxml::LN_Value_ST_NumberFormat_decimalZero:
+            nRet = style::NumberingType::ARABIC_ZERO;
+            break;
         default: nRet = style::NumberingType::ARABIC;
     }
 /*  TODO: Lots of additional values are available - some are supported in the I18 framework
@@ -593,7 +596,6 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
     NS_ooxml::LN_Value_ST_NumberFormat_decimalHalfWidth = 91692;
     NS_ooxml::LN_Value_ST_NumberFormat_japaneseDigitalTenThousand = 91694;
     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedCircle = 91695;
-    NS_ooxml::LN_Value_ST_NumberFormat_decimalZero = 91699;
     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedFullstop = 91703;
     NS_ooxml::LN_Value_ST_NumberFormat_decimalEnclosedParen = 91704;
     NS_ooxml::LN_Value_ST_NumberFormat_ideographZodiacTraditional = 91709;


More information about the Libreoffice-commits mailing list