diff options
author | Tim Bartlett <github@tim.bartletts.id.au> | 2019-08-19 18:40:56 +1000 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-09-02 12:56:05 +0200 |
commit | 0fbcac4caa971bd8824c96fe9ef7d9338cd37cbc (patch) | |
tree | 7077d3909bc9c23089025aa4a97404c351365a92 | |
parent | 27dc3096f4a9c0614c20db4439b11d43d0b9b8c4 (diff) |
tdf#55436 - Add SYMBOL_CHICAGO numbering scheme (for footnotes)
Includes adding SYMBOL_CHICAGO translations to .docx import/export filters
Change-Id: I5212739d7d04ab400a3d2aa549cb7cfd8531a4b8
Reviewed-on: https://gerrit.libreoffice.org/78114
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 14 | ||||
-rw-r--r-- | include/editeng/svxenum.hxx | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/style/NumberingType.idl | 11 | ||||
-rw-r--r-- | svx/inc/numberingtype.hrc | 1 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx | bin | 0 -> 8909 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/dmapper/ConversionHelper.cxx | 4 |
8 files changed, 38 insertions, 2 deletions
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 89cd7d59c438..0bc9b1870116 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -67,6 +67,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 <sal/macros.h> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -226,6 +231,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 @@ -899,6 +908,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(); @@ -943,6 +956,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: + *, ߤ, ߥ, �a7;, **, ߤߤ 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 Binary files differnew file mode 100644 index 000000000000..5d27260ca832 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index e1696f902f98..cb252c87ded9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -696,6 +696,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 209a1a1aec0a..0a0a8a94badb 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6257,6 +6257,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 91624dae17dd..542a3cb55ecd 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -583,11 +583,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; |