[Libreoffice-commits] core.git: i18npool/inc i18npool/source i18npool/util
i18npool/inc/transliteration_OneToOne.hxx| 12 - i18npool/source/registerservices/registerservices.cxx| 95 +-- i18npool/source/transliteration/fullwidthToHalfwidth.cxx | 12 - i18npool/source/transliteration/halfwidthToFullwidth.cxx |8 - i18npool/util/i18npool.component | 57 ++--- 5 files changed, 87 insertions(+), 97 deletions(-) New commits: commit d2140a6320cd1cf4dea29b174cdb3bcb5261056b Author: Noel Grandin AuthorDate: Tue Aug 4 20:18:17 2020 +0200 Commit: Noel Grandin CommitDate: Sun Aug 9 09:01:11 2020 +0200 i18npool: create instances with uno constructors and rename some classes to match their UNO implementation name. See tdf#74608 for motivation. Change-Id: I16aa64781d30a500f234029da6f6b00a645c46bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100133 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/i18npool/inc/transliteration_OneToOne.hxx b/i18npool/inc/transliteration_OneToOne.hxx index 45a3f61a9a37..9c2f79f8072d 100644 --- a/i18npool/inc/transliteration_OneToOne.hxx +++ b/i18npool/inc/transliteration_OneToOne.hxx @@ -68,8 +68,8 @@ public: \ }; TRANSLITERATION_ONETOONE( fullwidthToHalfwidth ) -TRANSLITERATION_ONETOONE( fullwidthKatakanaToHalfwidthKatakana ) -TRANSLITERATION_ONETOONE( fullwidthToHalfwidthLikeASC ) +TRANSLITERATION_ONETOONE( FULLWIDTHKATAKANA_HALFWIDTHKATAKANA ) +TRANSLITERATION_ONETOONE( FULLWIDTH_HALFWIDTH_LIKE_ASC ) class halfwidthToFullwidth final : public transliteration_OneToOne { @@ -78,17 +78,17 @@ public: OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override; }; -class halfwidthKatakanaToFullwidthKatakana final : public transliteration_OneToOne +class HALFWIDTHKATAKANA_FULLWIDTHKATAKANA final : public transliteration_OneToOne { public: -halfwidthKatakanaToFullwidthKatakana(); +HALFWIDTHKATAKANA_FULLWIDTHKATAKANA(); OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override; }; -class halfwidthToFullwidthLikeJIS final : public transliteration_OneToOne +class HALFWIDTH_FULLWIDTH_LIKE_JIS final : public transliteration_OneToOne { public: -halfwidthToFullwidthLikeJIS(); +HALFWIDTH_FULLWIDTH_LIKE_JIS(); OUString transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, css::uno::Sequence< sal_Int32 >& offset, bool useOffset ) override; }; diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index 8a5dc3c52e3c..878fc3c3de50 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -202,10 +202,12 @@ IMPL_UNO_CONSTRUCTOR( NumToCharEastIndic_ar ) IMPL_CREATEINSTANCE( NumToCharIndic_hi ) IMPL_CREATEINSTANCE( NumToChar_th ) -IMPL_CREATEINSTANCE( CharToNumLower_zh_CN ) -IMPL_CREATEINSTANCE( CharToNumUpper_zh_CN ) -IMPL_CREATEINSTANCE( CharToNumLower_zh_TW ) -IMPL_CREATEINSTANCE( CharToNumUpper_zh_TW ) +#if WITH_LOCALE_ALL || WITH_LOCALE_zh +IMPL_UNO_CONSTRUCTOR (CharToNumUpper_zh_CN) +IMPL_UNO_CONSTRUCTOR (CharToNumLower_zh_CN) +IMPL_UNO_CONSTRUCTOR (CharToNumUpper_zh_TW) +IMPL_UNO_CONSTRUCTOR (CharToNumLower_zh_TW) +#endif #if WITH_LOCALE_ALL || WITH_LOCALE_ja IMPL_UNO_CONSTRUCTOR( CharToNumFullwidth ) IMPL_UNO_CONSTRUCTOR( CharToNumKanjiShort_ja_JP ) @@ -239,12 +241,14 @@ IMPL_CREATEINSTANCE( NumToTextKanjiLongModern_ja_JP ) IMPL_CREATEINSTANCE( NumToTextKanjiLongTraditional_ja_JP ) IMPL_CREATEINSTANCE( NumToTextKanjiShortModern_ja_JP ) IMPL_CREATEINSTANCE( NumToTextKanjiShortTraditional_ja_JP ) -IMPL_CREATEINSTANCE( NumToTextFormalHangul_ko ) -IMPL_CREATEINSTANCE( NumToTextFormalLower_ko ) -IMPL_CREATEINSTANCE( NumToTextFormalUpper_ko ) -IMPL_CREATEINSTANCE( NumToTextInformalHangul_ko ) -IMPL_CREATEINSTANCE( NumToTextInformalUpper_ko ) -IMPL_CREATEINSTANCE( NumToTextInformalLower_ko ) +#if WITH_LOCALE_ALL || WITH_LOCALE_ko +IMPL_UNO_CONSTRUCTOR (NumToTextInformalHangul_ko) +IMPL_UNO_CONSTRUCTOR (NumToTextInformalLower_ko) +IMPL_UNO_CONSTRUCTOR (NumToTextInformalUpper_ko) +IMPL_UNO_CONSTRUCTOR (NumToTextFormalHangul_ko) +IMPL_UNO_CONSTRUCTOR (NumToTextFormalLower_ko) +IMPL_UNO_CONSTRUCTOR (NumToTextFormalUpper_ko) +#endif IMPL_CREATEINSTANCE( TextToNumLower_zh_CN ) IMPL_CREATEINSTANCE( TextToNumUpper_zh_CN ) @@ -260,22 +264,28 @@ IMPL_CREATEINSTANCE( TextToNumInformalUpper_ko ) IMPL_CREATEINSTANCE( TextToNumInformalLower_ko ) IMPL_CREATEINSTANCE( NumToTextDate_zh ) -IMPL_CREATEINSTANCE( NumToTextAIUFullWidth_ja_JP ) -IMPL_CREATEINSTANCE( NumToTextAIUHalfWidth_ja_JP ) -IMPL_CREATEINSTANCE( NumToTextIROHAFullWidth_ja_JP ) -IMPL_CREATEINSTANCE( NumToTextIROHAHalfWidth_ja_JP ) +#if WITH_LOCALE_ALL
[Libreoffice-commits] core.git: i18npool/inc i18npool/source i18npool/util
i18npool/inc/calendar_gregorian.hxx |8 i18npool/inc/indexentrysupplier_ja_phonetic.hxx | 13 i18npool/source/calendar/calendar_gregorian.cxx | 23 + i18npool/source/registerservices/registerservices.cxx | 297 +- i18npool/util/i18npool.component | 138 +--- 5 files changed, 220 insertions(+), 259 deletions(-) New commits: commit 155c056b1d4674d5ff73bbb5e1ad1dcd1e6aae36 Author: Noel Grandin AuthorDate: Wed Jul 29 20:04:44 2020 +0200 Commit: Noel Grandin CommitDate: Wed Jul 29 22:16:50 2020 +0200 i18npool: create instances with uno constructors See tdf#74608 for motivation. Change-Id: I814512ccc546bd015558a8122f0d2e3803437e38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99722 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx index 10bde05b2027..f66300d42e0a 100644 --- a/i18npool/inc/calendar_gregorian.hxx +++ b/i18npool/inc/calendar_gregorian.hxx @@ -151,10 +151,16 @@ class Calendar_hanja final : public Calendar_gregorian public: // Constructors Calendar_hanja(); -virtual void SAL_CALL loadCalendar(const OUString& uniqueID, const css::lang::Locale& rLocale) override; virtual OUString SAL_CALL getDisplayName(sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType) override; }; +class Calendar_hanja_yoil final : public Calendar_gregorian +{ +public: +// Constructors +Calendar_hanja_yoil(); +virtual OUString SAL_CALL getDisplayName(sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType) override; +}; class Calendar_gengou final : public Calendar_gregorian diff --git a/i18npool/inc/indexentrysupplier_ja_phonetic.hxx b/i18npool/inc/indexentrysupplier_ja_phonetic.hxx index cced5597c22d..e376796ad0d1 100644 --- a/i18npool/inc/indexentrysupplier_ja_phonetic.hxx +++ b/i18npool/inc/indexentrysupplier_ja_phonetic.hxx @@ -42,21 +42,22 @@ public: const css::lang::Locale& rLocale2 ) override; }; -#define INDEXENTRYSUPPLIER_JA_PHONETIC( algorithm ) \ +#define INDEXENTRYSUPPLIER_JA_PHONETIC( algorithm, algo_descr ) \ class IndexEntrySupplier_##algorithm final : public IndexEntrySupplier_ja_phonetic {\ public:\ IndexEntrySupplier_##algorithm (const css::uno::Reference < css::uno::XComponentContext >& rxContext) : IndexEntrySupplier_ja_phonetic (rxContext) {\ -implementationName = "com.sun.star.i18n.IndexEntrySupplier_"#algorithm;\ +implementationName = "com.sun.star.i18n.IndexEntrySupplier_"#algo_descr;\ };\ virtual sal_Bool SAL_CALL loadAlgorithm(\ const css::lang::Locale& rLocale,\ const OUString& SortAlgorithm, sal_Int32 collatorOptions ) override;\ }; -INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_first_by_syllable ) -INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_first_by_consonant ) -INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_last_by_syllable ) -INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_last_by_consonant ) +/** descriptions formed by concatenating strings here must match names in .component file */ +INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_first_by_syllable, " (alphanumeric first) (grouped by syllable)" ) +INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_first_by_consonant, " (alphanumeric first) (grouped by consonant)" ) +INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_last_by_syllable, " (alphanumeric last) (grouped by consonant)" ) +INDEXENTRYSUPPLIER_JA_PHONETIC( ja_phonetic_alphanumeric_last_by_consonant, " (alphanumeric last) (grouped by consonant)" ) } #endif diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 3aa516814538..69fb08797ab3 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -201,14 +201,27 @@ Calendar_hanja::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16 return Calendar_gregorian::getDisplayName( displayIndex, idx, nameType ); } -void SAL_CALL -Calendar_hanja::loadCalendar( const OUString& /*uniqueID*/, const css::lang::Locale& rLocale ) + +Calendar_hanja_yoil::Calendar_hanja_yoil() +{ +cCalendar = "com.sun.star.i18n.Calendar_Calendar_hanja_yoil"; +} + +OUString SAL_CALL +Calendar_hanja_yoil::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16 nameType ) { -// Since this class could be called by service name 'hanja_yoil', we have to -// rename uniqueID to get right calendar defined in locale data. -Calendar_gregorian::loadCalendar("hanja", rLocale); +if ( displayIndex == CalendarDisplayIndex::AM_PM ) { +// Am/Pm string for Korean Hanja calendar will refer to Japanese locale +css::lang::Locale jaLocale("ja", OUString(), OUString());
[Libreoffice-commits] core.git: i18npool/inc i18npool/source i18npool/util
i18npool/inc/calendar_gregorian.hxx | 10 ++ i18npool/source/calendar/calendar_gregorian.cxx | 13 + i18npool/source/registerservices/registerservices.cxx |4 i18npool/util/i18npool.component |3 +++ 4 files changed, 30 insertions(+) New commits: commit 5e67aa92a8f08fe488c9344851c2f819d4eaa542 Author: DaeHyun Sung AuthorDate: Sat May 25 09:33:33 2019 +0900 Commit: Eike Rathke CommitDate: Sat Jun 1 01:21:06 2019 +0200 Support to Korean Dangi Calendar for tdf#125446 Support to Korean Traditional Calendar, Dan-gi(단기/檀紀) Calendar The era name, Dangi(단기,檀紀) originating from the foundation of Gojoseon[고조선/古朝鮮] is also widely used in Korea as an indication of long civilization of Korea. Full name: `Dangun-giwon (단군기원, 檀君紀元 "First Age of Lord Dangun")` Abbreviation Name: `Dangi(단기,檀紀)` The Dangi Calendar measures years from the ancient founding of Korea in 2333 B.C. Reference. ICU Library ICU library support Dangi Calendar. ICU4C 50 http://bugs.icu-project.org/trac/ticket/9255 ICU4J 51 http://bugs.icu-project.org/trac/ticket/9616 Change-Id: I490b8b288c68f498eb29d4fcc73251cbef3ac6d4 Reviewed-on: https://gerrit.libreoffice.org/72943 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx index 6d343f33f28d..894f2246e30b 100644 --- a/i18npool/inc/calendar_gregorian.hxx +++ b/i18npool/inc/calendar_gregorian.hxx @@ -177,6 +177,16 @@ public: }; +// class Calendar_dangi + +class Calendar_dangi : public Calendar_gregorian +{ +public: +// Constructors +Calendar_dangi(); +}; + + // class Calendar_buddhist class Calendar_buddhist : public Calendar_gregorian diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 45a9de3bf3ef..18676361027a 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -226,6 +226,19 @@ Calendar_ROC::Calendar_ROC() : Calendar_gregorian(ROC_eraArray) cCalendar = "com.sun.star.i18n.Calendar_ROC"; } +/** +* The start year of the Korean traditional calendar (Dan-gi) is the inaugural +* year of Dan-gun (BC 2333). +*/ +static const Era dangi_eraArray[] = { +{-2332, 1, 1, 0}, +{0, 0, 0, 0} +}; +Calendar_dangi::Calendar_dangi() : Calendar_gregorian(dangi_eraArray) +{ +cCalendar = "com.sun.star.i18n.Calendar_dangi"; +} + static const Era buddhist_eraArray[] = { {-542, 1, 1, 0}, {0, 0, 0, 0} diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index f6c187c83a56..dd891558696d 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -114,6 +114,7 @@ IMPL_CREATEINSTANCE( Calendar_gregorian ) IMPL_CREATEINSTANCE( Calendar_hanja ) IMPL_CREATEINSTANCE( Calendar_gengou ) IMPL_CREATEINSTANCE( Calendar_ROC ) +IMPL_CREATEINSTANCE( Calendar_dangi ) IMPL_CREATEINSTANCE( Calendar_hijri ) IMPL_CREATEINSTANCE( Calendar_jewish ) IMPL_CREATEINSTANCE( Calendar_buddhist ) @@ -295,6 +296,9 @@ static const struct InstancesArray { { "com.sun.star.i18n.Calendar_ROC", "com.sun.star.i18n.Calendar_ROC", _ROC_CreateInstance }, +{ "com.sun.star.i18n.Calendar_dangi", +"com.sun.star.i18n.Calendar_dangi", +_dangi_CreateInstance }, { "com.sun.star.i18n.Calendar_hanja_yoil", "com.sun.star.i18n.Calendar_hanja_yoil", _hanja_CreateInstance }, diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component index d4e7ea7b0a35..0b419d2f80f5 100644 --- a/i18npool/util/i18npool.component +++ b/i18npool/util/i18npool.component @@ -49,6 +49,9 @@ + + + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: i18npool/inc i18npool/source i18npool/util include/svl include/unotools offapi/com offapi/UnoApi_offapi.mk svl/qa svl/source unotools/source
i18npool/inc/nativenumbersupplier.hxx | 17 +- i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 19 +- i18npool/source/nativenumber/nativenumbersupplier.cxx | 44 +++--- i18npool/util/i18npool.component |1 include/svl/zformat.hxx |6 include/unotools/nativenumberwrapper.hxx | 12 + offapi/UnoApi_offapi.mk |2 offapi/com/sun/star/i18n/NativeNumberMode.idl | 13 - offapi/com/sun/star/i18n/NativeNumberSupplier2.idl| 45 ++ offapi/com/sun/star/i18n/XNativeNumberSupplier2.idl | 69 ++ svl/qa/unit/svl.cxx |4 svl/source/numbers/zformat.cxx| 35 - unotools/source/i18n/nativenumberwrapper.cxx | 28 +++- 13 files changed, 237 insertions(+), 58 deletions(-) New commits: commit 90d233b0311a208967a3e264820e00395bf057fb Author: Mike Kaganski Date: Sun May 13 03:09:43 2018 +0300 tdf#115007: Use [NatNum12 params...] syntax This allows using all the libnumbertext library functions. [NatNum12] gives cardinal number names (one, two, three, ...) [NatNum12 ordinal] gives ordinal number names (first, second, third, ...) [NatNum12 ordinal-number] gives ordinal indicators (1st, 2nd, 3rd, ...) [NatNum12 money USD][$-409] gives formal English (US) money text ... etc (see numbertext.org for syntax). Change-Id: I16dbb44d8d4bdb82a1b950de6d438c8311b554ff Reviewed-on: https://gerrit.libreoffice.org/54366 Tested-by: Jenkins Reviewed-by: László Németh diff --git a/i18npool/inc/nativenumbersupplier.hxx b/i18npool/inc/nativenumbersupplier.hxx index e248a1812004..d17c39fe7490 100644 --- a/i18npool/inc/nativenumbersupplier.hxx +++ b/i18npool/inc/nativenumbersupplier.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_I18NPOOL_INC_NATIVENUMBERSUPPLIER_HXX #define INCLUDED_I18NPOOL_INC_NATIVENUMBERSUPPLIER_HXX -#include +#include #include #include #include @@ -32,7 +32,7 @@ namespace i18npool { // class NativeNumberSupplierService : public cppu::WeakImplHelper < -css::i18n::XNativeNumberSupplier, +css::i18n::XNativeNumberSupplier2, css::lang::XServiceInfo > { @@ -52,6 +52,11 @@ public: virtual sal_Int16 SAL_CALL convertFromXmlAttributes( const css::i18n::NativeNumberXmlAttributes& aAttr ) override; +// XNativeNumberSupplier2 +virtual OUString SAL_CALL getNativeNumberStringParams( +const OUString& rNumberString, const css::lang::Locale& rLocale, +sal_Int16 nNativeNumberMode, const OUString& rNativeNumberParams) override; + //XServiceInfo virtual OUString SAL_CALL getImplementationName() override; virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; @@ -59,9 +64,11 @@ public: // following methods are not for XNativeNumberSupplier, they are for calling from transliterations /// @throws css::uno::RuntimeException -OUString getNativeNumberString( const OUString& aNumberString, -const css::lang::Locale& aLocale, sal_Int16 nNativeNumberMode, -css::uno::Sequence< sal_Int32 >& offset ); +OUString getNativeNumberString(const OUString& rNumberString, + const css::lang::Locale& rLocale, + sal_Int16 nNativeNumberMode, + css::uno::Sequence& offset, + const OUString& rNativeNumberParams = OUString()); /// @throws css::uno::RuntimeException sal_Unicode getNativeNumberChar( const sal_Unicode inChar, const css::lang::Locale& aLocale, sal_Int16 nNativeNumberMode ) ; diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index af4e27d0f69f..45a222ce9efd 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -585,6 +585,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence xNatNum(new NativeNumberSupplierService); -OUString aNum -= xNatNum->getNativeNumberString(OUString::number(number), locale, natNum); +OUString aNum = xNatNum->getNativeNumberStringParams(OUString::number(number), locale, + natNum, sNatNumParams); if (bCapitalize)
[Libreoffice-commits] core.git: i18npool/inc i18npool/source i18npool/util
i18npool/inc/localedata.hxx |9 +++-- i18npool/source/localedata/localedata.cxx | 46 +- i18npool/util/i18npool.component |1 3 files changed, 52 insertions(+), 4 deletions(-) New commits: commit ba9f44d6ee560bbba09834b1070d19ec62d35783 Author: Eike RathkeDate: Thu Oct 26 21:34:17 2017 +0200 Implement LocaleData2, XLocaleData5, LocaleDataItem2, tdf#81671 Change-Id: Idba5a30bc44c7b2bd951f954ea3bfd048b022660 Reviewed-on: https://gerrit.libreoffice.org/43920 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/i18npool/inc/localedata.hxx b/i18npool/inc/localedata.hxx index c3aa6cf57d2c..4a83d44375b2 100644 --- a/i18npool/inc/localedata.hxx +++ b/i18npool/inc/localedata.hxx @@ -23,7 +23,7 @@ #include -#include +#include #include @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ namespace i18npool { class LocaleDataImpl : public cppu::WeakImplHelper < -css::i18n::XLocaleData4, +css::i18n::XLocaleData5, css::lang::XServiceInfo > { @@ -108,6 +108,9 @@ public: // XLocaleData4 virtual css::uno::Sequence< OUString > SAL_CALL getDateAcceptancePatterns( const css::lang::Locale& rLocale ) override; +// XLocaleData5 +virtual css::i18n::LocaleDataItem2 SAL_CALL getLocaleItem2( const css::lang::Locale& rLocale ) override; + // following methods are used by indexentry service /// @throws css::uno::RuntimeException css::uno::Sequence< OUString > SAL_CALL getIndexAlgorithm( const css::lang::Locale& rLocale ); diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 500a9408136e..e84f2b6282e7 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -423,6 +423,47 @@ LocaleDataImpl::getLocaleItem( const Locale& rLocale ) } } + +LocaleDataItem2 SAL_CALL +LocaleDataImpl::getLocaleItem2( const Locale& rLocale ) +{ +MyFunc_Type func = reinterpret_cast(getFunctionSymbol( rLocale, "getLocaleItem" )); + +if ( func ) { +sal_Int16 dataItemCount = 0; +sal_Unicode **dataItem = func(dataItemCount); + +assert(dataItemCount >= 18); + +LocaleDataItem2 item( +dataItem[0], +dataItem[1], +dataItem[2], +dataItem[3], +dataItem[4], +dataItem[5], +dataItem[6], +dataItem[7], +dataItem[8], +dataItem[9], +dataItem[10], +dataItem[11], +dataItem[12], +dataItem[13], +dataItem[14], +dataItem[15], +dataItem[16], +dataItem[17], +dataItemCount >= 19 ? dataItem[18] : OUString() +); +return item; +} +else { +LocaleDataItem2 item1; +return item1; +} +} + #ifndef DISABLE_DYNLOADING extern "C" { static void SAL_CALL thisModule() {} } @@ -1560,7 +1601,10 @@ sal_Bool SAL_CALL LocaleDataImpl::supportsService(const OUString& rServiceName) Sequence< OUString > SAL_CALL LocaleDataImpl::getSupportedServiceNames() { -Sequence< OUString > aRet { "com.sun.star.i18n.LocaleData" }; +Sequence< OUString > aRet { +"com.sun.star.i18n.LocaleData", +"com.sun.star.i18n.LocaleData2" +}; return aRet; } diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component index 1b74fd736f54..3598ffa8b781 100644 --- a/i18npool/util/i18npool.component +++ b/i18npool/util/i18npool.component @@ -128,6 +128,7 @@ + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits