summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorFaisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa>2014-04-08 09:42:20 +0300
committerFaisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa>2014-04-08 10:58:15 +0300
commitd2771b63b94a8aae3c25c83e9dae9f83242f46c1 (patch)
tree976ff93c1bf86829f0a2aa9b42b48f08a7df25f1 /i18npool
parent411297a0ad63a3b7484005fd2ad27dd53b58c3d7 (diff)
fdo#77123: Add option ignore kashida to the search
This patch will add new checkbox to ignore kashida in the search and replace dialog. Change-Id: I9e7179242751103b8418d922ade5b9145170ad15
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/Library_i18npool.mk1
-rw-r--r--i18npool/inc/transliteration_Ignore.hxx4
-rw-r--r--i18npool/source/localedata/data/ar_EG.xml1
-rw-r--r--i18npool/source/registerservices/registerservices.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreKashida_CTL.cxx35
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx4
-rw-r--r--i18npool/util/i18npool.component3
7 files changed, 50 insertions, 0 deletions
diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk
index f8900bf0fb65..4f9e5999a17a 100644
--- a/i18npool/Library_i18npool.mk
+++ b/i18npool/Library_i18npool.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_Library_add_exception_objects,i18npool,\
i18npool/source/transliteration/ignoreWidth \
i18npool/source/transliteration/ignoreZiZu_ja_JP \
i18npool/source/transliteration/ignoreDiacritics_CTL \
+ i18npool/source/transliteration/ignoreKashida_CTL \
i18npool/source/transliteration/katakanaToHiragana \
i18npool/source/transliteration/largeToSmall_ja_JP \
i18npool/source/transliteration/numtochar \
diff --git a/i18npool/inc/transliteration_Ignore.hxx b/i18npool/inc/transliteration_Ignore.hxx
index a1aa29ec5dfe..691b8677e1c0 100644
--- a/i18npool/inc/transliteration_Ignore.hxx
+++ b/i18npool/inc/transliteration_Ignore.hxx
@@ -118,6 +118,10 @@ TRANSLITERATION_IGNORE(ZiZu_ja_JP)
TRANSLITERATION_IGNORE(Diacritics_CTL)
#endif
+#if defined( TRANSLITERATION_Kashida_CTL ) || defined( TRANSLITERATION_ALL )
+TRANSLITERATION_IGNORE(Kashida_CTL)
+#endif
+
#undef TRANSLITERATION_IGNORE
#define TRANSLITERATION_IGNORE( name ) \
diff --git a/i18npool/source/localedata/data/ar_EG.xml b/i18npool/source/localedata/data/ar_EG.xml
index 662a913d8a55..7e52d518d907 100644
--- a/i18npool/source/localedata/data/ar_EG.xml
+++ b/i18npool/source/localedata/data/ar_EG.xml
@@ -466,6 +466,7 @@
<Transliteration unoid="TOGGLE_CASE"/>
<Transliteration unoid="IGNORE_CASE"/>
<Transliteration unoid="ignoreDiacritics_CTL"/>
+ <Transliteration unoid="ignoreKashida_CTL"/>
</LC_TRANSLITERATION>
<LC_MISC>
<ReservedWords>
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index 93b38d72a0df..67c59e61b9d2 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -156,6 +156,7 @@ IMPL_CREATEINSTANCE( ignoreProlongedSoundMark_ja_JP)
IMPL_CREATEINSTANCE( ignoreMiddleDot_ja_JP)
IMPL_CREATEINSTANCE( ignoreSpace_ja_JP)
IMPL_CREATEINSTANCE( ignoreDiacritics_CTL)
+IMPL_CREATEINSTANCE( ignoreKashida_CTL)
IMPL_CREATEINSTANCE( TextToChuyin_zh_TW )
IMPL_CREATEINSTANCE( TextToPinyin_zh_CN )
@@ -381,6 +382,7 @@ static const struct InstancesArray {
IMPL_TRANSLITERATION_ITEM (TextToPinyin_zh_CN),
IMPL_TRANSLITERATION_ITEM (TextToChuyin_zh_TW),
IMPL_TRANSLITERATION_ITEM( ignoreDiacritics_CTL),
+ IMPL_TRANSLITERATION_ITEM (ignoreKashida_CTL),
IMPL_TRANSLITERATION_ITEM (NumToCharUpper_zh_CN),
IMPL_TRANSLITERATION_ITEM (NumToCharLower_zh_CN),
diff --git a/i18npool/source/transliteration/ignoreKashida_CTL.cxx b/i18npool/source/transliteration/ignoreKashida_CTL.cxx
new file mode 100644
index 000000000000..ff0303dbf217
--- /dev/null
+++ b/i18npool/source/transliteration/ignoreKashida_CTL.cxx
@@ -0,0 +1,35 @@
+/* -*- 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_Kashida_CTL
+#include <transliteration_Ignore.hxx>
+
+namespace com { namespace sun { namespace star { namespace i18n {
+
+sal_Unicode
+ignoreKashida_CTL_translator (const sal_Unicode c)
+{
+ if( c == 0x0640 ) // Check if it's Kashida
+ return 0xffff; // Then skip this character
+
+ return c;
+}
+
+ignoreKashida_CTL::ignoreKashida_CTL()
+{
+ func = ignoreKashida_CTL_translator;
+ table = 0;
+ map = 0;
+ transliterationName = "ignoreKashida_CTL";
+ implementationName = "com.sun.star.i18n.Transliteration.ignoreKashida_CTL";
+}
+
+} } } }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index 85014b6a3092..7e1d7bf7f34e 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -199,6 +199,10 @@ TransliterationImpl::loadModule( TransliterationModules modType, const Locale& r
if (loadModuleByName(OUString("ignoreDiacritics_CTL"), bodyCascade[numCascade], rLocale))
numCascade++;
}
+ if (modType & TransliterationModulesExtra::ignoreKashida_CTL)
+ if (loadModuleByName(OUString("ignoreKashida_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) {
diff --git a/i18npool/util/i18npool.component b/i18npool/util/i18npool.component
index 9873934226c4..9617a8b4151b 100644
--- a/i18npool/util/i18npool.component
+++ b/i18npool/util/i18npool.component
@@ -492,4 +492,7 @@
<implementation name="com.sun.star.i18n.Transliteration.ignoreDiacritics_CTL">
<service name="com.sun.star.i18n.Transliteration.l10n"/>
</implementation>
+ <implementation name="com.sun.star.i18n.Transliteration.ignoreKashida_CTL">
+ <service name="com.sun.star.i18n.Transliteration.l10n"/>
+ </implementation>
</component>