summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-11-23 23:06:10 +0100
committerEike Rathke <erack@redhat.com>2012-11-23 23:09:16 +0100
commitaf60316514f3ae3d4c475819bf86f2af837171e3 (patch)
treeccfbd673bd4a53047a04dad6457d09c7eea1566c /editeng/source
parent37f5b864014e9ad17a561b77ea9f6141650e92ad (diff)
some i18n wrappers with LanguageTag
Change-Id: I2ceaa3159e8669c2c569fa8559c1e061dcad399d
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/editeng.cxx6
-rw-r--r--editeng/source/items/svxfont.cxx4
-rw-r--r--editeng/source/misc/forbiddencharacterstable.cxx2
-rw-r--r--editeng/source/misc/hangulhanja.cxx2
-rw-r--r--editeng/source/misc/svxacorr.cxx18
5 files changed, 15 insertions, 17 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 8b191ea116fb..6a42c910ee67 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1362,12 +1362,12 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
String aComplete;
LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1));
- lang::Locale aLocale( LanguageTag( eLang).getLocale());
+ LanguageTag aLanguageTag( eLang);
if (!pImpEditEngine->xLocaleDataWrapper.isInitialized())
- pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLocale, eLang);
+ pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag);
else
- pImpEditEngine->xLocaleDataWrapper.changeLocale( aLocale, eLang);
+ pImpEditEngine->xLocaleDataWrapper.changeLocale( aLanguageTag);
if (!pImpEditEngine->xTransliterationWrapper.isInitialized())
pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE);
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 7077905f2aa0..61cf0db1d689 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -110,7 +110,7 @@ OUString SvxFont::CalcCaseMap(const OUString &rTxt) const
const LanguageType eLng = LANGUAGE_DONTKNOW == eLang
? LANGUAGE_SYSTEM : eLang;
- CharClass aCharClass( SvxCreateLocale( eLng ) );
+ CharClass aCharClass( LanguageTag( SvxCreateLocale( eLng )) );
switch( eCaseMap )
{
@@ -221,7 +221,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
const LanguageType eLng = LANGUAGE_DONTKNOW == eLang
? LANGUAGE_SYSTEM : eLang;
- CharClass aCharClass( SvxCreateLocale( eLng ) );
+ CharClass aCharClass( LanguageTag( SvxCreateLocale( eLng )) );
String aCharString;
while( nPos < nTxtLen )
diff --git a/editeng/source/misc/forbiddencharacterstable.cxx b/editeng/source/misc/forbiddencharacterstable.cxx
index 5c4f3c8a0ff8..8365f32fb704 100644
--- a/editeng/source/misc/forbiddencharacterstable.cxx
+++ b/editeng/source/misc/forbiddencharacterstable.cxx
@@ -38,7 +38,7 @@ const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::Ge
pForbiddenCharacters = &(it->second);
else if ( bGetDefault && m_xContext.is() )
{
- LocaleDataWrapper aWrapper( m_xContext, SvxCreateLocale( nLanguage ) );
+ LocaleDataWrapper aWrapper( m_xContext, LanguageTag( SvxCreateLocale( nLanguage )) );
maMap[ nLanguage ] = aWrapper.getForbiddenCharacters();
pForbiddenCharacters = &maMap[ nLanguage ];
}
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index c51519626153..4083d6bb5ca5 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -607,7 +607,7 @@ namespace editeng
{ // found asian text
// determine if it's Hangul
- CharClass aCharClassificaton( m_xContext, m_aSourceLocale );
+ CharClass aCharClassificaton( m_xContext, LanguageTag( m_aSourceLocale) );
sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< sal_uInt16 >(nNextAsianScript) );
if ( ( UnicodeScript_kHangulJamo == nScript )
|| ( UnicodeScript_kHangulCompatibilityJamo == nScript )
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 9bce44939317..7a322f33ed95 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -202,13 +202,11 @@ static sal_uInt16 GetAppLang()
}
static LocaleDataWrapper& GetLocaleDataWrapper( sal_uInt16 nLang )
{
- static LocaleDataWrapper aLclDtWrp( SvxCreateLocale( GetAppLang() ) );
- ::com::sun::star::lang::Locale aLcl( SvxCreateLocale( nLang ));
- const ::com::sun::star::lang::Locale& rLcl = aLclDtWrp.getLoadedLocale();
- if( aLcl.Language != rLcl.Language ||
- aLcl.Country != rLcl.Country ||
- aLcl.Variant != rLcl.Variant )
- aLclDtWrp.setLocale( aLcl );
+ static LocaleDataWrapper aLclDtWrp( LanguageTag( SvxCreateLocale( GetAppLang() )) );
+ LanguageTag aLcl( LanguageTag( SvxCreateLocale( nLang )));
+ const LanguageTag& rLcl = aLclDtWrp.getLoadedLanguageTag();
+ if( aLcl != rLcl )
+ aLclDtWrp.setLanguageTag( aLcl );
return aLclDtWrp;
}
static TransliterationWrapper& GetIgnoreTranslWrapper()
@@ -339,7 +337,7 @@ SvxAutoCorrect::~SvxAutoCorrect()
void SvxAutoCorrect::_GetCharClass( LanguageType eLang )
{
delete pCharClass;
- pCharClass = new CharClass( SvxCreateLocale( eLang ));
+ pCharClass = new CharClass( LanguageTag( SvxCreateLocale( eLang )));
eCharClassLang = eLang;
}
@@ -468,7 +466,7 @@ sal_Bool SvxAutoCorrect::FnChgOrdinalNumber(
if ( xOrdSuffix.is( ) )
{
- uno::Sequence< rtl::OUString > aSuffixes = xOrdSuffix->getOrdinalSuffix( nNum, rCC.getLocale( ) );
+ uno::Sequence< rtl::OUString > aSuffixes = xOrdSuffix->getOrdinalSuffix( nNum, rCC.getLanguageTag().getLocale( ) );
for ( sal_Int32 nSuff = 0; nSuff < aSuffixes.getLength(); nSuff++ )
{
String sSuffix( aSuffixes[ nSuff ] );
@@ -611,7 +609,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace(
bool bRet = false;
CharClass& rCC = GetCharClass( eLang );
- const lang::Locale rLocale = rCC.getLocale( );
+ const lang::Locale rLocale = rCC.getLanguageTag().getLocale( );
if ( rLocale.Language == OUString( "fr" ) )
{