diff options
Diffstat (limited to 'unotools/source/i18n/transliterationwrapper.cxx')
-rw-r--r-- | unotools/source/i18n/transliterationwrapper.cxx | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index 062e34286d4b..a10a52802e19 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -31,11 +31,12 @@ #include <unotools/transliterationwrapper.hxx> #include <tools/debug.hxx> #include <i18npool/mslangid.hxx> -#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_ #include <comphelper/componentfactory.hxx> -#endif + #include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/i18n/TransliterationModulesExtra.hpp> #define TRANSLIT_LIBRARYNAME "i18n" #define TRANSLIT_SERVICENAME "com.sun.star.i18n.Transliteration" @@ -147,7 +148,10 @@ sal_Bool TransliterationWrapper::needLanguageForTheMode() const { return TransliterationModules_UPPERCASE_LOWERCASE == nType || TransliterationModules_LOWERCASE_UPPERCASE == nType || - TransliterationModules_IGNORE_CASE == nType; + TransliterationModules_IGNORE_CASE == nType || + (sal_uInt32) TransliterationModulesExtra::SENTENCE_CASE == (sal_uInt32) nType || + (sal_uInt32) TransliterationModulesExtra::TITLE_CASE == (sal_uInt32) nType || + (sal_uInt32) TransliterationModulesExtra::TOGGLE_CASE == (sal_uInt32) nType; } @@ -165,14 +169,32 @@ void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang ) sal_Bool bLoad = bFirstCall; bFirstCall = sal_False; - if( nLanguage != nLang ) + if( static_cast< sal_Int32 >(nType) == TransliterationModulesExtra::SENTENCE_CASE ) { - setLanguageLocaleImpl( nLang ); - if( !bLoad ) - bLoad = needLanguageForTheMode(); + if( bLoad ) + loadModuleByImplName(String::CreateFromAscii("SENTENCE_CASE"), nLang); + } + else if( static_cast< sal_Int32 >(nType) == TransliterationModulesExtra::TITLE_CASE ) + { + if( bLoad ) + loadModuleByImplName(String::CreateFromAscii("TITLE_CASE"), nLang); + } + else if( static_cast< sal_Int32 >(nType) == TransliterationModulesExtra::TOGGLE_CASE ) + { + if( bLoad ) + loadModuleByImplName(String::CreateFromAscii("TOGGLE_CASE"), nLang); + } + else + { + if( nLanguage != nLang ) + { + setLanguageLocaleImpl( nLang ); + if( !bLoad ) + bLoad = needLanguageForTheMode(); + } + if( bLoad ) + loadModuleImpl(); } - if( bLoad ) - loadModuleImpl(); } |