diff options
author | abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa> | 2013-06-21 11:07:34 +0200 |
---|---|---|
committer | abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa> | 2013-06-21 11:14:17 +0200 |
commit | 448fa131b2dafac305d88480e469cc4bc0515d68 (patch) | |
tree | 4f8f94215ce38a9c7ccb0d3edb4af3bb62aa5b38 /i18npool/source | |
parent | 832612bb6bd013cf68a64e33827158f96e6d03d3 (diff) |
Fix fdo#52204 add new feature ignore diacritics in search for CTL
Change-Id: Ie9044a35003217545bacea214ef59047bff3b8b1
Diffstat (limited to 'i18npool/source')
-rw-r--r-- | i18npool/source/localedata/data/ar_DZ.xml | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/data/ar_EG.xml | 10 | ||||
-rw-r--r-- | i18npool/source/localedata/data/ar_LB.xml | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/data/ar_OM.xml | 6 | ||||
-rw-r--r-- | i18npool/source/localedata/data/ar_SA.xml | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/data/ar_TN.xml | 2 | ||||
-rw-r--r-- | i18npool/source/registerservices/registerservices.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/transliteration/ignoreDiacritics_CTL.cxx | 45 | ||||
-rw-r--r-- | i18npool/source/transliteration/transliterationImpl.cxx | 7 |
9 files changed, 68 insertions, 10 deletions
diff --git a/i18npool/source/localedata/data/ar_DZ.xml b/i18npool/source/localedata/data/ar_DZ.xml index c3c3be7a678e..bb63392202d3 100644 --- a/i18npool/source/localedata/data/ar_DZ.xml +++ b/i18npool/source/localedata/data/ar_DZ.xml @@ -453,7 +453,7 @@ <DecimalPlaces>2</DecimalPlaces> </Currency> </LC_CURRENCY> - <LC_TRANSLITERATION ref="en_US"/> + <LC_TRANSLITERATION ref="ar_EG"/> <LC_MISC ref="ar_EG"/> <LC_NumberingLevel ref="ar_EG"/> <LC_OutLineNumberingLevel ref="ar_EG"/> diff --git a/i18npool/source/localedata/data/ar_EG.xml b/i18npool/source/localedata/data/ar_EG.xml index defa49ec9ac4..662a913d8a55 100644 --- a/i18npool/source/localedata/data/ar_EG.xml +++ b/i18npool/source/localedata/data/ar_EG.xml @@ -458,7 +458,15 @@ <DecimalPlaces>2</DecimalPlaces> </Currency> </LC_CURRENCY> - <LC_TRANSLITERATION ref="en_US"/> + <LC_TRANSLITERATION> + <Transliteration unoid="SENTENCE_CASE"/> + <Transliteration unoid="LOWERCASE_UPPERCASE"/> + <Transliteration unoid="UPPERCASE_LOWERCASE"/> + <Transliteration unoid="TITLE_CASE"/> + <Transliteration unoid="TOGGLE_CASE"/> + <Transliteration unoid="IGNORE_CASE"/> + <Transliteration unoid="ignoreDiacritics_CTL"/> + </LC_TRANSLITERATION> <LC_MISC> <ReservedWords> <trueWord>صح</trueWord> diff --git a/i18npool/source/localedata/data/ar_LB.xml b/i18npool/source/localedata/data/ar_LB.xml index 86aba6114901..9499dfb8ba48 100644 --- a/i18npool/source/localedata/data/ar_LB.xml +++ b/i18npool/source/localedata/data/ar_LB.xml @@ -300,7 +300,7 @@ <DecimalPlaces>2</DecimalPlaces> </Currency> </LC_CURRENCY> - <LC_TRANSLITERATION ref="en_US"/> + <LC_TRANSLITERATION ref="ar_EG"/> <LC_MISC ref="ar_EG"/> <LC_NumberingLevel ref="ar_EG"/> <LC_OutLineNumberingLevel ref="ar_EG"/> diff --git a/i18npool/source/localedata/data/ar_OM.xml b/i18npool/source/localedata/data/ar_OM.xml index d29304696ff7..5c4bfd73ff55 100644 --- a/i18npool/source/localedata/data/ar_OM.xml +++ b/i18npool/source/localedata/data/ar_OM.xml @@ -341,11 +341,7 @@ <DecimalPlaces>2</DecimalPlaces> </Currency> </LC_CURRENCY> - <LC_TRANSLITERATION> - <Transliteration unoid="LOWERCASE_UPPERCASE"/> - <Transliteration unoid="UPPERCASE_LOWERCASE"/> - <Transliteration unoid="IGNORE_CASE"/> - </LC_TRANSLITERATION> + <LC_TRANSLITERATION ref="ar_EG"/> <LC_MISC> <ReservedWords> <trueWord>صحيح</trueWord> diff --git a/i18npool/source/localedata/data/ar_SA.xml b/i18npool/source/localedata/data/ar_SA.xml index 01b596c63658..05f0fb81edb3 100644 --- a/i18npool/source/localedata/data/ar_SA.xml +++ b/i18npool/source/localedata/data/ar_SA.xml @@ -300,7 +300,7 @@ <DecimalPlaces>2</DecimalPlaces> </Currency> </LC_CURRENCY> - <LC_TRANSLITERATION ref="en_US"/> + <LC_TRANSLITERATION ref="ar_EG"/> <LC_MISC ref="ar_EG"/> <LC_NumberingLevel ref="ar_EG"/> <LC_OutLineNumberingLevel ref="ar_EG"/> diff --git a/i18npool/source/localedata/data/ar_TN.xml b/i18npool/source/localedata/data/ar_TN.xml index b69ad31a3ad2..014f77524603 100644 --- a/i18npool/source/localedata/data/ar_TN.xml +++ b/i18npool/source/localedata/data/ar_TN.xml @@ -300,7 +300,7 @@ <DecimalPlaces>3</DecimalPlaces> </Currency> </LC_CURRENCY> - <LC_TRANSLITERATION ref="en_US"/> + <LC_TRANSLITERATION ref="ar_EG"/> <LC_MISC ref="ar_EG"/> <LC_NumberingLevel ref="ar_EG"/> <LC_OutLineNumberingLevel ref="ar_EG"/> diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx index b9c19b082bc5..ca87c024ef6f 100644 --- a/i18npool/source/registerservices/registerservices.cxx +++ b/i18npool/source/registerservices/registerservices.cxx @@ -190,6 +190,7 @@ IMPL_CREATEINSTANCE( ignoreSize_ja_JP) IMPL_CREATEINSTANCE( ignoreProlongedSoundMark_ja_JP) IMPL_CREATEINSTANCE( ignoreMiddleDot_ja_JP) IMPL_CREATEINSTANCE( ignoreSpace_ja_JP) +IMPL_CREATEINSTANCE( ignoreDiacritics_CTL) IMPL_CREATEINSTANCE( TextToChuyin_zh_TW ) IMPL_CREATEINSTANCE( TextToPinyin_zh_CN ) @@ -465,6 +466,7 @@ static const struct InstancesArray { IMPL_TRANSLITERATION_ITEM (ignoreSpace_ja_JP), IMPL_TRANSLITERATION_ITEM (TextToPinyin_zh_CN), IMPL_TRANSLITERATION_ITEM (TextToChuyin_zh_TW), + IMPL_TRANSLITERATION_ITEM( ignoreDiacritics_CTL), IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_CN), IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_CN), diff --git a/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx new file mode 100644 index 000000000000..f4de2c5b2bc1 --- /dev/null +++ b/i18npool/source/transliteration/ignoreDiacritics_CTL.cxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#define TRANSLITERATION_Diacritics_CTL +#include <transliteration_Ignore.hxx> + +namespace com { namespace sun { namespace star { namespace i18n { + +sal_Unicode +ignoreDiacritics_CTL_translator (const sal_Unicode c) +{ + switch (c) { + //Arabic Diacritics + case 0x064B: + case 0x064C: + case 0x064D: + case 0x064E: + case 0x064F: + case 0x0650: + case 0x0651: + case 0x0652: + // no break; + return 0xffff; // Skip this character + } + return c; +} + +ignoreDiacritics_CTL::ignoreDiacritics_CTL() +{ + func = ignoreDiacritics_CTL_translator; + table = 0; + map = 0; + transliterationName = "ignoreDiacritics_CTL"; + implementationName = "com.sun.star.i18n.Transliteration.ignoreDiacritics_CTL"; +} + +} } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index e8f3f2c168be..fddb41c7b905 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/i18n/LocaleData.hpp> #include <com/sun/star/i18n/TransliterationType.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <comphelper/processfactory.hxx> @@ -191,6 +192,12 @@ TransliterationImpl::loadModule( TransliterationModules modType, const Locale& r bodyCascade[numCascade], rLocale)) numCascade++; } + // additional transliterations from TranslationModuleExtra (we cannot extend TransliterationModule) + if (modType & TransliterationModulesExtra::ignoreDiacritics_CTL) + { + if (loadModuleByName(OUString("ignoreDiacritics_CTL"), bodyCascade[numCascade], rLocale)) + numCascade++; + } } else if (modType&TransliterationModules_NON_IGNORE_MASK) { for (sal_Int16 i = 0; TMlist[i].tm; i++) { if (TMlist[i].tm == modType) { |