summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-08-04 20:18:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-09 09:01:11 +0200
commitd2140a6320cd1cf4dea29b174cdb3bcb5261056b (patch)
treea50a03afa9a20f9b933eb260d0dfc8f4885a80ef /i18npool/source
parent2c6e81468e5fc0a26a150e9442a7f371d63cbd65 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/registerservices/registerservices.cxx95
-rw-r--r--i18npool/source/transliteration/fullwidthToHalfwidth.cxx12
-rw-r--r--i18npool/source/transliteration/halfwidthToFullwidth.cxx8
3 files changed, 42 insertions, 73 deletions
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 || WITH_LOCALE_ja
+IMPL_UNO_CONSTRUCTOR (NumToTextAIUFullWidth_ja_JP)
+IMPL_UNO_CONSTRUCTOR (NumToTextAIUHalfWidth_ja_JP)
+IMPL_UNO_CONSTRUCTOR (NumToTextIROHAFullWidth_ja_JP)
+IMPL_UNO_CONSTRUCTOR (NumToTextIROHAHalfWidth_ja_JP)
+#endif
IMPL_CREATEINSTANCE( NumToTextCircledNumber )
-IMPL_CREATEINSTANCE( NumToTextHangulJamo_ko )
-IMPL_CREATEINSTANCE( NumToTextHangulSyllable_ko )
-IMPL_CREATEINSTANCE( NumToTextHangulCircledJamo_ko )
-IMPL_CREATEINSTANCE( NumToTextHangulCircledSyllable_ko )
+#if WITH_LOCALE_ALL || WITH_LOCALE_ko
+IMPL_UNO_CONSTRUCTOR (NumToTextHangulJamo_ko)
+IMPL_UNO_CONSTRUCTOR (NumToTextHangulSyllable_ko)
+IMPL_UNO_CONSTRUCTOR (NumToTextHangulCircledJamo_ko)
+IMPL_UNO_CONSTRUCTOR (NumToTextHangulCircledSyllable_ko)
+#endif
IMPL_CREATEINSTANCE( NumToTextTianGan_zh )
IMPL_CREATEINSTANCE( NumToTextDiZi_zh )
-IMPL_CREATEINSTANCE( fullwidthKatakanaToHalfwidthKatakana )
-IMPL_CREATEINSTANCE( halfwidthKatakanaToFullwidthKatakana )
-IMPL_CREATEINSTANCE( fullwidthToHalfwidthLikeASC )
-IMPL_CREATEINSTANCE( halfwidthToFullwidthLikeJIS )
+#if WITH_LOCALE_ALL || WITH_LOCALE_ja
+IMPL_UNO_CONSTRUCTOR (FULLWIDTHKATAKANA_HALFWIDTHKATAKANA)
+IMPL_UNO_CONSTRUCTOR (HALFWIDTHKATAKANA_FULLWIDTHKATAKANA)
+IMPL_UNO_CONSTRUCTOR (FULLWIDTH_HALFWIDTH_LIKE_ASC)
+IMPL_UNO_CONSTRUCTOR (HALFWIDTH_FULLWIDTH_LIKE_JIS)
+#endif
namespace {
@@ -372,13 +382,6 @@ const InstancesArray aInstances[] = {
IMPL_TRANSLITERATION_ITEM (NumToChar_th),
#endif
-#if WITH_LOCALE_ALL || WITH_LOCALE_zh
- IMPL_TRANSLITERATION_ITEM (CharToNumUpper_zh_CN),
- IMPL_TRANSLITERATION_ITEM (CharToNumLower_zh_CN),
- IMPL_TRANSLITERATION_ITEM (CharToNumUpper_zh_TW),
- IMPL_TRANSLITERATION_ITEM (CharToNumLower_zh_TW),
-#endif
-
#if WITH_LOCALE_ALL || WITH_LOCALE_ja
IMPL_TRANSLITERATION_ITEM (NumToTextFullwidth_ja_JP),
#endif
@@ -391,14 +394,6 @@ const InstancesArray aInstances[] = {
IMPL_TRANSLITERATION_ITEM (NumToTextKanjiShortModern_ja_JP),
IMPL_TRANSLITERATION_ITEM (NumToTextKanjiShortTraditional_ja_JP),
#endif
-#if WITH_LOCALE_ALL || WITH_LOCALE_ko
- IMPL_TRANSLITERATION_ITEM (NumToTextInformalHangul_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextInformalLower_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextInformalUpper_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextFormalHangul_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextFormalLower_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextFormalUpper_ko),
-#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_zh
IMPL_TRANSLITERATION_ITEM (TextToNumUpper_zh_CN),
@@ -422,38 +417,12 @@ const InstancesArray aInstances[] = {
#if WITH_LOCALE_ALL || WITH_LOCALE_zh
IMPL_TRANSLITERATION_ITEM (NumToTextDate_zh),
#endif
-#if WITH_LOCALE_ALL || WITH_LOCALE_ja
- IMPL_TRANSLITERATION_ITEM (NumToTextAIUFullWidth_ja_JP),
- IMPL_TRANSLITERATION_ITEM (NumToTextAIUHalfWidth_ja_JP),
- IMPL_TRANSLITERATION_ITEM (NumToTextIROHAFullWidth_ja_JP),
- IMPL_TRANSLITERATION_ITEM (NumToTextIROHAHalfWidth_ja_JP),
-#endif
IMPL_TRANSLITERATION_ITEM (NumToTextCircledNumber),
-#if WITH_LOCALE_ALL || WITH_LOCALE_ko
- IMPL_TRANSLITERATION_ITEM (NumToTextHangulJamo_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextHangulSyllable_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextHangulCircledJamo_ko),
- IMPL_TRANSLITERATION_ITEM (NumToTextHangulCircledSyllable_ko),
-#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_zh
IMPL_TRANSLITERATION_ITEM (NumToTextTianGan_zh),
IMPL_TRANSLITERATION_ITEM (NumToTextDiZi_zh),
#endif
-#if WITH_LOCALE_ALL || WITH_LOCALE_ja
- { TRLT_SERVICELNAME_L10N,
- TRLT_IMPLNAME_PREFIX "FULLWIDTHKATAKANA_HALFWIDTHKATAKANA",
- &fullwidthKatakanaToHalfwidthKatakana_CreateInstance },
- { TRLT_SERVICELNAME_L10N,
- TRLT_IMPLNAME_PREFIX "HALFWIDTHKATAKANA_FULLWIDTHKATAKANA",
- &halfwidthKatakanaToFullwidthKatakana_CreateInstance },
- { TRLT_SERVICELNAME_L10N,
- TRLT_IMPLNAME_PREFIX "FULLWIDTH_HALFWIDTH_LIKE_ASC",
- &fullwidthToHalfwidthLikeASC_CreateInstance },
- { TRLT_SERVICELNAME_L10N,
- TRLT_IMPLNAME_PREFIX "HALFWIDTH_FULLWIDTH_LIKE_JIS",
- &halfwidthToFullwidthLikeJIS_CreateInstance },
-#endif
// add here new services !!
{ nullptr, nullptr, nullptr }
};
diff --git a/i18npool/source/transliteration/fullwidthToHalfwidth.cxx b/i18npool/source/transliteration/fullwidthToHalfwidth.cxx
index 226d0ef40ec5..1ae6a379fd94 100644
--- a/i18npool/source/transliteration/fullwidthToHalfwidth.cxx
+++ b/i18npool/source/transliteration/fullwidthToHalfwidth.cxx
@@ -62,7 +62,7 @@ fullwidthToHalfwidth::transliterateChar2Char( sal_Unicode inChar)
return transliteration_OneToOne::transliterateChar2Char(inChar);
}
-fullwidthKatakanaToHalfwidthKatakana::fullwidthKatakanaToHalfwidthKatakana()
+FULLWIDTHKATAKANA_HALFWIDTHKATAKANA::FULLWIDTHKATAKANA_HALFWIDTHKATAKANA()
{
func = nullptr;
table = &i18nutil::widthfolding::getfullKana2halfKanaTable();
@@ -74,7 +74,7 @@ fullwidthKatakanaToHalfwidthKatakana::fullwidthKatakanaToHalfwidthKatakana()
* Transliterate fullwidth katakana to halfwidth katakana.
*/
OUString
-fullwidthKatakanaToHalfwidthKatakana::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
+FULLWIDTHKATAKANA_HALFWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
{
// Decomposition: GA --> KA + voice-mark
const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, offset, useOffset);
@@ -84,7 +84,7 @@ fullwidthKatakanaToHalfwidthKatakana::transliterateImpl( const OUString& inStr,
}
sal_Unicode SAL_CALL
-fullwidthKatakanaToHalfwidthKatakana::transliterateChar2Char( sal_Unicode inChar )
+FULLWIDTHKATAKANA_HALFWIDTHKATAKANA::transliterateChar2Char( sal_Unicode inChar )
{
sal_Unicode newChar = i18nutil::widthfolding::decompose_ja_voiced_sound_marksChar2Char (inChar);
if (newChar == 0xFFFF)
@@ -92,7 +92,7 @@ fullwidthKatakanaToHalfwidthKatakana::transliterateChar2Char( sal_Unicode inChar
return transliteration_OneToOne::transliterateChar2Char(inChar);
}
-fullwidthToHalfwidthLikeASC::fullwidthToHalfwidthLikeASC()
+FULLWIDTH_HALFWIDTH_LIKE_ASC::FULLWIDTH_HALFWIDTH_LIKE_ASC()
{
func = nullptr;
table = &i18nutil::widthfolding::getfull2halfTableForASC();
@@ -104,7 +104,7 @@ fullwidthToHalfwidthLikeASC::fullwidthToHalfwidthLikeASC()
* Transliterate fullwidth to halfwidth like Excel's ASC function.
*/
OUString
-fullwidthToHalfwidthLikeASC::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
+FULLWIDTH_HALFWIDTH_LIKE_ASC::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
{
// Decomposition: GA --> KA + voice-mark
const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, offset, useOffset);
@@ -114,7 +114,7 @@ fullwidthToHalfwidthLikeASC::transliterateImpl( const OUString& inStr, sal_Int32
}
sal_Unicode SAL_CALL
-fullwidthToHalfwidthLikeASC::transliterateChar2Char( sal_Unicode inChar )
+FULLWIDTH_HALFWIDTH_LIKE_ASC::transliterateChar2Char( sal_Unicode inChar )
{
sal_Unicode newChar = i18nutil::widthfolding::decompose_ja_voiced_sound_marksChar2Char (inChar);
if (newChar == 0xFFFF)
diff --git a/i18npool/source/transliteration/halfwidthToFullwidth.cxx b/i18npool/source/transliteration/halfwidthToFullwidth.cxx
index e9d6ebd89c61..e69e245f16d7 100644
--- a/i18npool/source/transliteration/halfwidthToFullwidth.cxx
+++ b/i18npool/source/transliteration/halfwidthToFullwidth.cxx
@@ -45,7 +45,7 @@ halfwidthToFullwidth::transliterateImpl( const OUString& inStr, sal_Int32 startP
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, useOffset );
}
-halfwidthKatakanaToFullwidthKatakana::halfwidthKatakanaToFullwidthKatakana()
+HALFWIDTHKATAKANA_FULLWIDTHKATAKANA::HALFWIDTHKATAKANA_FULLWIDTHKATAKANA()
{
func = nullptr;
table = &i18nutil::widthfolding::gethalfKana2fullKanaTable();
@@ -54,7 +54,7 @@ halfwidthKatakanaToFullwidthKatakana::halfwidthKatakanaToFullwidthKatakana()
}
OUString
-halfwidthKatakanaToFullwidthKatakana::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
+HALFWIDTHKATAKANA_FULLWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
{
// One to One mapping
const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, offset, false);
@@ -63,7 +63,7 @@ halfwidthKatakanaToFullwidthKatakana::transliterateImpl( const OUString& inStr,
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), offset, useOffset );
}
-halfwidthToFullwidthLikeJIS::halfwidthToFullwidthLikeJIS()
+HALFWIDTH_FULLWIDTH_LIKE_JIS::HALFWIDTH_FULLWIDTH_LIKE_JIS()
{
func = nullptr;
table = &i18nutil::widthfolding::gethalf2fullTableForJIS();
@@ -72,7 +72,7 @@ halfwidthToFullwidthLikeJIS::halfwidthToFullwidthLikeJIS()
}
OUString
-halfwidthToFullwidthLikeJIS::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
+HALFWIDTH_FULLWIDTH_LIKE_JIS::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset, bool useOffset )
{
// One to One mapping
const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, offset, false);