[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - i18npool/source include/editeng offapi/com svx/inc sw/qa sw/source writerfilter/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 2 07:05:40 UTC 2020


 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |   14 +++++++
 include/editeng/svxenum.hxx                                           |    4 +-
 offapi/com/sun/star/style/NumberingType.idl                           |   18 ++++++++++
 svx/inc/numberingtype.hrc                                             |    1 
 sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx                |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                              |    6 +++
 sw/source/filter/ww8/docxattributeoutput.cxx                          |    1 
 writerfilter/source/dmapper/ConversionHelper.cxx                      |    4 +-
 8 files changed, 46 insertions(+), 2 deletions(-)

New commits:
commit cb1a5aa51adfebe6ca5e0d39a3ed84daf8d6dd39
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Mar 2 17:17:56 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Apr 2 09:05:23 2020 +0200

    sw padded numbering: add doc model and UNO API
    
    The idea is to behave similar to Arabic numbering, but pad the result on
    the left up to 2 characters. Word has this feature, so far Writer falled
    back to plain Arabic numbering.
    
    This is just the document model, not layout yet.
    
    (cherry picked from commit 6b80bd446de4bf19df3a9b124881e1fe12402ca8)
    
    Change-Id: I8ac90536848d00b8678129184db0849130724dee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91500
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx
index 3c4bbe266347..f425e97cde0c 100644
--- a/include/editeng/svxenum.hxx
+++ b/include/editeng/svxenum.hxx
@@ -205,7 +205,8 @@ enum SvxNumType : sal_Int16
     SVX_NUM_TEXT_NUMBER           = css::style::NumberingType::TEXT_NUMBER,
     SVX_NUM_TEXT_CARDINAL         = css::style::NumberingType::TEXT_CARDINAL,
     SVX_NUM_TEXT_ORDINAL          = css::style::NumberingType::TEXT_ORDINAL,
-    SVX_NUM_SYMBOL_CHICAGO        = css::style::NumberingType::SYMBOL_CHICAGO
+    SVX_NUM_SYMBOL_CHICAGO        = css::style::NumberingType::SYMBOL_CHICAGO,
+    SVX_NUM_ARABIC_ZERO           = css::style::NumberingType::ARABIC_ZERO
 };
 
 #endif
diff --git a/offapi/com/sun/star/style/NumberingType.idl b/offapi/com/sun/star/style/NumberingType.idl
index 183d719c89a2..66159a818e66 100644
--- a/offapi/com/sun/star/style/NumberingType.idl
+++ b/offapi/com/sun/star/style/NumberingType.idl
@@ -492,6 +492,13 @@ published constants NumberingType
         ASTERISK ASTERISK, DAGGER DAGGER, etc.
       */
     const short SYMBOL_CHICAGO = 63;
+
+    /** Numbering is in Arabic numbers, padded with zero to have a length of at least two, as "01,
+        02, ..., 10, 11, ...".
+
+        @since LibreOffice 7.0
+     */
+    const short ARABIC_ZERO = 64;
 };
 
 
commit ea58353bafbb646c09ee95a7e9884323306efddf
Author:     Tim Bartlett <github at tim.bartletts.id.au>
AuthorDate: Mon Aug 19 18:40:56 2019 +1000
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Apr 2 09:05:08 2020 +0200

    tdf#55436 - Add SYMBOL_CHICAGO numbering scheme (for footnotes)
    
    Includes adding SYMBOL_CHICAGO translations to .docx import/export filters
    
    (cherry picked from commit 0fbcac4caa971bd8824c96fe9ef7d9338cd37cbc)
    
    Conflicts:
            i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
    
    Change-Id: I5212739d7d04ab400a3d2aa549cb7cfd8531a4b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91499
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 899ea58457d3..b7963de5c0b5 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -66,6 +66,11 @@
 #define S_HI_TWO "\xDB\xB2"
 #define S_HI_THREE "\xDB\xB3"
 
+// Chicago footnote symbols
+#define S_DAGGER "\xE2\x80\xA0"
+#define S_DBL_DAGGER "\xE2\x80\xA1"
+#define S_SECTION "\xC2\xA7"
+
 #include <math.h>
 #include <sal/macros.h>
 #include <rtl/ustring.hxx>
@@ -229,6 +234,10 @@ static const sal_Unicode lowerLetter[] = {
     0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A
 };
 
+static const sal_Unicode table_Chicago[] = {
+    0x002a, 0x2020, 0x2021, 0x00a7
+};
+
 // Tables used for numbering in persian words
 static const sal_Unicode table_PersianWord_decade1[][7]={
     {0},                                                 // 0
@@ -902,6 +911,10 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
               lcl_formatPersianWord(number, result);
               break;
 
+          case SYMBOL_CHICAGO:
+             lcl_formatChars1( table_Chicago, 4, number-1, result );  // *, +, |, S, **, ++, ...
+             break;
+
           default:
                OSL_ASSERT(false);
                throw IllegalArgumentException();
@@ -945,6 +958,7 @@ static const Supported_NumberingType aSupportedTypes[] =
         {style::NumberingType::CHAR_SPECIAL,                    "Bullet", LANG_ALL},
         {style::NumberingType::PAGE_DESCRIPTOR,                 "Page", LANG_ALL},
         {style::NumberingType::BITMAP,                          "Bitmap", LANG_ALL},
+        {style::NumberingType::SYMBOL_CHICAGO,          "*, " S_DAGGER ", " S_DBL_DAGGER ", " S_SECTION ", **, " S_DAGGER S_DAGGER ", ...", LANG_ALL},
         {style::NumberingType::TEXT_NUMBER,             "1st", LANG_ALL},
         {style::NumberingType::TEXT_CARDINAL,           "One", LANG_ALL},
         {style::NumberingType::TEXT_ORDINAL,            "First", LANG_ALL},
diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx
index ad7a2d5053e1..3c4bbe266347 100644
--- a/include/editeng/svxenum.hxx
+++ b/include/editeng/svxenum.hxx
@@ -204,7 +204,8 @@ enum SvxNumType : sal_Int16
     SVX_NUM_NUMBER_INDIC_DEVANAGARI  = css::style::NumberingType::NUMBER_INDIC_DEVANAGARI,
     SVX_NUM_TEXT_NUMBER           = css::style::NumberingType::TEXT_NUMBER,
     SVX_NUM_TEXT_CARDINAL         = css::style::NumberingType::TEXT_CARDINAL,
-    SVX_NUM_TEXT_ORDINAL          = css::style::NumberingType::TEXT_ORDINAL
+    SVX_NUM_TEXT_ORDINAL          = css::style::NumberingType::TEXT_ORDINAL,
+    SVX_NUM_SYMBOL_CHICAGO        = css::style::NumberingType::SYMBOL_CHICAGO
 };
 
 #endif
diff --git a/offapi/com/sun/star/style/NumberingType.idl b/offapi/com/sun/star/style/NumberingType.idl
index 6bcb43f6e77a..183d719c89a2 100644
--- a/offapi/com/sun/star/style/NumberingType.idl
+++ b/offapi/com/sun/star/style/NumberingType.idl
@@ -481,6 +481,17 @@ published constants NumberingType
         @since LibreOffice 6.1
      */
     const short TEXT_ORDINAL = 62;
+
+    /** Footnoting symbols according the University of Chicago style:
+          *, ߤ, ߥ, &#00a7;, **, ߤߤ etc.
+
+        @since LibreOffice 6.4
+     */
+     /*
+        ASTERISK, DAGGER, DOUBLE DAGGER, SECTION SIGN,
+        ASTERISK ASTERISK, DAGGER DAGGER, etc.
+      */
+    const short SYMBOL_CHICAGO = 63;
 };
 
 
diff --git a/svx/inc/numberingtype.hrc b/svx/inc/numberingtype.hrc
index 989f0be0aec4..37cdbbd3c0f6 100644
--- a/svx/inc/numberingtype.hrc
+++ b/svx/inc/numberingtype.hrc
@@ -40,6 +40,7 @@ const std::pair<const char*, int> RID_SVXSTRARY_NUMBERINGTYPE[] =
     { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "First, Second, Third, ...") ,           62 /* TEXT_ORDINAL                     */ },
     { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "A, .., AA, .., AAA, ...") ,             9  /* SVX_NUM_CHARS_UPPER_LETTER_N     */ },
     { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "a, .., aa, .., aaa, ...") ,             10 /* SVX_NUM_CHARS_LOWER_LETTER_N     */ },
+    { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "*, †, ‡, §, **, ††, ...") ,             63 /* SYMBOL_CHICAGO                   */ },
     { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "Native Numbering") ,                    12 /* NATIVE_NUMBERING                 */ },
     { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "А, Б, .., Аа, Аб, ... (Bulgarian)") ,   38 /* CHARS_CYRILLIC_UPPER_LETTER_BG   */ },
     { NC_("RID_SVXSTRARY_NUMBERINGTYPE", "а, б, .., аа, аб, ... (Bulgarian)") ,   39 /* CHARS_CYRILLIC_LOWER_LETTER_BG   */ },
diff --git a/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx b/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx
new file mode 100644
index 000000000000..5d27260ca832
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b9be20c37146..4f26633b4c3e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -697,6 +697,12 @@ DECLARE_OOXMLEXPORT_TEST(testOoxmlTextOrdinalList, "text_ordinal_list.docx")
     CPPUNIT_ASSERT_EQUAL(style::NumberingType::TEXT_ORDINAL, numFormat);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testOoxmlSymbolChicagoList, "symbol_chicago_list.docx")
+{
+    sal_Int16   numFormat = getNumberingTypeOfParagraph(1);
+    CPPUNIT_ASSERT_EQUAL(style::NumberingType::SYMBOL_CHICAGO, numFormat);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testOoxmlNumListZHTW, "numlist-zhtw.odt")
 {
     xmlDocPtr pXmlDoc = parseExport("word/numbering.xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index d0ad6a0c11df..f75d4aa0d02d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6490,6 +6490,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
         case style::NumberingType::TEXT_NUMBER: aType="ordinal"; break;
         case style::NumberingType::TEXT_CARDINAL: aType="cardinalText"; break;
         case style::NumberingType::TEXT_ORDINAL: aType="ordinalText"; break;
+        case style::NumberingType::SYMBOL_CHICAGO: aType="chicago"; 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 7206a7fde18a..996c284f1779 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -582,11 +582,13 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
         case NS_ooxml::LN_Value_ST_NumberFormat_ordinalText:
             nRet = style::NumberingType::TEXT_ORDINAL;
             break;
+        case NS_ooxml::LN_Value_ST_NumberFormat_chicago:
+            nRet = style::NumberingType::SYMBOL_CHICAGO;
+            break;
         default: nRet = style::NumberingType::ARABIC;
     }
 /*  TODO: Lots of additional values are available - some are supported in the I18 framework
     NS_ooxml::LN_Value_ST_NumberFormat_hex = 91685;
-    NS_ooxml::LN_Value_ST_NumberFormat_chicago = 91686;
     NS_ooxml::LN_Value_ST_NumberFormat_decimalFullWidth = 91691;
     NS_ooxml::LN_Value_ST_NumberFormat_decimalHalfWidth = 91692;
     NS_ooxml::LN_Value_ST_NumberFormat_japaneseDigitalTenThousand = 91694;


More information about the Libreoffice-commits mailing list