diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-23 16:15:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-01 07:28:03 +0000 |
commit | 4c09fc48e9fa9114f32f2973090cbe75177cdd37 (patch) | |
tree | 09d4ee3c2d75d038f45ba13a086a344d35aeadb6 /i18nutil | |
parent | d97380c66904328e9d706a0b03a6800dc048aa7d (diff) |
typesafe wrappers for css::i18nutil::TransliterationModules
and related css::util::SearchOptions2
The TransliterationModules enum has it's constants spread over multiple
UNO enum/constant-collections - TransliterationModules and
TransliterationModulesExtra, which means that most code simply uses
sal_Int32.
Wrap them up into a better bundle so that only the lowest layer needs to
deal directly with the UNO constants.
Change-Id: I1edeab79fcc7817a4a97c933ef84ab7015bb849b
Reviewed-on: https://gerrit.libreoffice.org/34582
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18nutil')
-rw-r--r-- | i18nutil/source/utility/casefolding.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx index 22bce0925594..1f6c0608471a 100644 --- a/i18nutil/source/utility/casefolding.cxx +++ b/i18nutil/source/utility/casefolding.cxx @@ -20,6 +20,7 @@ #include "i18nutil/casefolding.hxx" #include "casefolding_data.h" #include "i18nutil/widthfolding.hxx" +#include "i18nutil/transliteration.hxx" using namespace com::sun::star::lang; using namespace com::sun::star::uno; @@ -129,7 +130,7 @@ is_ja_voice_sound_mark(sal_Unicode& current, sal_Unicode next) return c != 0; } -sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, Locale& aLocale, MappingType nMappingType, TransliterationModules moduleLoaded) +sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal_Int32 len, MappingElement& e, Locale& aLocale, MappingType nMappingType, TransliterationFlags moduleLoaded) { if( idx >= len ) { @@ -139,7 +140,7 @@ sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal sal_Unicode c; - if (moduleLoaded & TransliterationModules_IGNORE_CASE) { + if (moduleLoaded & TransliterationFlags::IGNORE_CASE) { if( e.current >= e.element.nmap ) { e.element = getValue(str, idx++, len, aLocale, nMappingType); e.current = 0; @@ -149,13 +150,13 @@ sal_Unicode casefolding::getNextChar(const sal_Unicode *str, sal_Int32& idx, sal c = *(str + idx++); } - if (moduleLoaded & TransliterationModules_IGNORE_KANA) { + if (moduleLoaded & TransliterationFlags::IGNORE_KANA) { if ((0x3040 <= c && c <= 0x3094) || (0x309d <= c && c <= 0x309f)) c += 0x60; } // composition: KA + voice-mark --> GA. see halfwidthToFullwidth.cxx for detail - if (moduleLoaded & TransliterationModules_IGNORE_WIDTH) { + if (moduleLoaded & TransliterationFlags::IGNORE_WIDTH) { static oneToOneMapping& half2fullTable = widthfolding::gethalf2fullTable(); c = half2fullTable[c]; if (0x3040 <= c && c <= 0x30ff && idx < len && |