diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-04-07 13:01:58 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-04-07 13:01:58 +0000 |
commit | d91580e70c66a5624aef6e7cfd519fcca0ab5e0f (patch) | |
tree | e1682cb78110f213b0b28a7b9e3c5144bc3efa8d /svx | |
parent | 2b14b54765cacc4f55e5a1ebf7f1c0de4fba69b7 (diff) |
INTEGRATION: CWS internatiodel (1.93.322); FILE MERGED
2006/02/10 22:00:21 er 1.93.322.4: RESYNC: (1.96-1.97); FILE MERGED
2006/02/10 19:27:51 er 1.93.322.3: #i52115# move LangIDs and ISO conversion from tools to i18npool; introduce class MsLangId and libi18nisolang
2006/01/19 22:28:09 er 1.93.322.2: RESYNC: (1.93-1.96); FILE MERGED
2005/06/24 13:09:19 er 1.93.322.1: #i50205# get rid of class International
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/editeng/editeng.cxx | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx index 3617ff8af5fa..068e7f21b0f8 100644 --- a/svx/source/editeng/editeng.cxx +++ b/svx/source/editeng/editeng.cxx @@ -4,9 +4,9 @@ * * $RCSfile: editeng.cxx,v $ * - * $Revision: 1.98 $ + * $Revision: 1.99 $ * - * last change: $Author: vg $ $Date: 2006-03-14 09:40:04 $ + * last change: $Author: vg $ $Date: 2006-04-07 14:01:58 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -96,6 +96,10 @@ #include <sfx2/sfxuno.hxx> #endif +#ifndef INCLUDED_I18NPOOL_MSLANGID_HXX +#include <i18npool/mslangid.hxx> +#endif + #ifndef _SV_HELP_HXX //autogen #include <vcl/help.hxx> #endif @@ -1103,12 +1107,27 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie { String aComplete; - International aInt = International( pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1 ) ) ); - for( int n = MONDAY; n <= SUNDAY; ++n ) + LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1)); + lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang)); + + if (!pImpEditEngine->xLocaleDataWrapper.isInitialized()) + pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getServiceFactory(), aLocale, eLang); + else + pImpEditEngine->xLocaleDataWrapper.changeLocale( aLocale, eLang); + + if (!pImpEditEngine->xTransliterationWrapper.isInitialized()) + pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getServiceFactory(), eLang, i18n::TransliterationModules_IGNORE_CASE); + else + pImpEditEngine->xTransliterationWrapper.changeLocale( eLang); + + const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->xTransliterationWrapper.get(); + Sequence< i18n::CalendarItem > xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarDays(); + sal_Int32 nCount = xItem.getLength(); + const i18n::CalendarItem* pArr = xItem.getArray(); + for( sal_Int32 n = 0; n <= nCount; ++n ) { - const String& rDay = aInt.GetDayText( (DayOfWeek)n ); - // MT: Auf International umstellen, wenn Compare mit Laengenangabe moeglich! - if( aWord.CompareIgnoreCaseToAscii( rDay, aWord.Len() ) == COMPARE_EQUAL ) + const ::rtl::OUString& rDay = pArr[n].FullName; + if( pTransliteration->isMatch( aWord, rDay) ) { aComplete = rDay; break; @@ -1117,11 +1136,13 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie if ( !aComplete.Len() ) { - for( int n = 1; n <= 12; ++n ) + xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarMonths(); + sal_Int32 nCount = xItem.getLength(); + const i18n::CalendarItem* pArr = xItem.getArray(); + for( sal_Int32 n = 0; n <= nCount; ++n ) { - const String& rMon = aInt.GetMonthText( n ); - // MT: Auf International umstellen, wenn Compare mit Laengenangabe moeglich! - if( aWord.CompareIgnoreCaseToAscii( rMon, aWord.Len() ) == COMPARE_EQUAL ) + const ::rtl::OUString& rMon = pArr[n].FullName; + if( pTransliteration->isMatch( aWord, rMon) ) { aComplete = rMon; break; |