summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Bartlett <github@tim.bartletts.id.au>2019-08-19 18:40:56 +1000
committerMiklos Vajna <vmiklos@collabora.com>2020-04-02 09:05:08 +0200
commitea58353bafbb646c09ee95a7e9884323306efddf (patch)
tree37830f2ceb0ccc4147d5ca01dbd654472d2ccd96
parentb62c2306f0db584e367dcbb6172a783179153008 (diff)
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@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx14
-rw-r--r--include/editeng/svxenum.hxx3
-rw-r--r--offapi/com/sun/star/style/NumberingType.idl11
-rw-r--r--svx/inc/numberingtype.hrc1
-rw-r--r--sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docxbin0 -> 8909 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx1
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx4
8 files changed, 38 insertions, 2 deletions
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:
+ *, &#2020;, &#2021;, &#00a7;, **, &#2020;&#2020; 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
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/symbol_chicago_list.docx
Binary files 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;