[Libreoffice-commits] .: 2 commits - svl/source tools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 16 08:20:48 PST 2012
svl/source/config/languageoptions.cxx | 3 ++-
svl/source/items/srchitem.cxx | 6 +++---
svl/source/numbers/numfmuno.cxx | 8 +++-----
svl/source/numbers/supservs.cxx | 2 +-
svl/source/numbers/zforlist.cxx | 11 +++++------
svl/source/numbers/zformat.cxx | 4 ++--
svl/source/numbers/zforscan.cxx | 2 +-
tools/source/rc/resmgr.cxx | 3 ++-
8 files changed, 19 insertions(+), 20 deletions(-)
New commits:
commit 59d33fcc19ec380f9af6e7c24a5e22e8e50428cc
Author: Eike Rathke <erack at redhat.com>
Date: Fri Nov 16 15:57:22 2012 +0100
use LanguageTag
Change-Id: I28aff5533ec6cc31a3d6f3de3198452bd716ba62
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index 5f7678a..c73318c 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -22,6 +22,7 @@
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
@@ -200,7 +201,7 @@ LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage()
{
if( m_sWin16SystemLocale.isEmpty() )
return LANGUAGE_NONE;
- return MsLangId::convertIsoStringToLanguage( m_sWin16SystemLocale );
+ return LanguageTag( m_sWin16SystemLocale ).getLanguageType();
}
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index d68a887..0f0b8d2 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -28,7 +28,7 @@
#include <com/sun/star/util/XReplaceDescriptor.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <svl/memberid.hrc>
-#include <i18npool/mslangid.hxx>
+#include <i18npool/languagetag.hxx>
using namespace utl;
using namespace com::sun::star::beans;
@@ -428,7 +428,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMembe
{
sal_Int16 nLocale;
if (!aSearchOpt.Locale.Language.isEmpty() || !aSearchOpt.Locale.Country.isEmpty() )
- nLocale = MsLangId::convertLocaleToLanguage( aSearchOpt.Locale );
+ nLocale = LanguageTag( aSearchOpt.Locale ).getLanguageType();
else
nLocale = LANGUAGE_NONE;
rVal <<= nLocale;
@@ -577,7 +577,7 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM
}
else
{
- MsLangId::convertLanguageToLocale( (sal_Int16) nInt, aSearchOpt.Locale );
+ aSearchOpt.Locale = LanguageTag( nInt).getLocale();
}
}
break;
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 29a469e..80ec23a 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -109,7 +109,7 @@ static LanguageType lcl_GetLanguage( const lang::Locale& rLocale )
if ( rLocale.Language.isEmpty() )
return LANGUAGE_SYSTEM;
- LanguageType eRet = MsLangId::convertLocaleToLanguage( rLocale );
+ LanguageType eRet = LanguageTag( rLocale ).getLanguageType( false );
if ( eRet == LANGUAGE_NONE )
eRet = LANGUAGE_SYSTEM; //! or throw an exception?
@@ -757,8 +757,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro
}
else if (aString.EqualsAscii( PROPERTYNAME_LOCALE ))
{
- lang::Locale aLocale( MsLangId::convertLanguageToLocale(
- pFormat->GetLanguage()));
+ lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale());
aRet <<= aLocale;
}
else if (aString.EqualsAscii( PROPERTYNAME_TYPE ))
@@ -893,8 +892,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue
bool bThousand, bRed;
sal_uInt16 nDecimals, nLeading;
pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading );
- lang::Locale aLocale( MsLangId::convertLanguageToLocale(
- pFormat->GetLanguage()));
+ lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale());
uno::Sequence<beans::PropertyValue> aSeq(13);
beans::PropertyValue* pArray = aSeq.getArray();
diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx
index caadfe4..1edfbdf 100644
--- a/svl/source/numbers/supservs.cxx
+++ b/svl/source/numbers/supservs.cxx
@@ -101,7 +101,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence<
{
Locale aLocale;
*pArgs >>= aLocale;
- eNewFormatterLanguage = MsLangId::convertLocaleToLanguage( aLocale);
+ eNewFormatterLanguage = LanguageTag( aLocale).getLanguageType( false);
}
#ifdef DBG_UTIL
else
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 106a372..c636a62 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -233,7 +233,7 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
eEvalDateFormat = NF_EVALDATEFORMAT_INTL;
nDefaultSystemCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
- aLocale = MsLangId::convertLanguageToLocale( eLang );
+ aLocale = LanguageTag( eLang ).getLocale();
pCharClass = new CharClass( comphelper::getComponentContext(xServiceManager), aLocale );
xLocaleData.init( comphelper::getComponentContext(xServiceManager), aLocale, eLang );
xCalendar.init( comphelper::getComponentContext(xServiceManager), aLocale );
@@ -266,7 +266,7 @@ void SvNumberFormatter::ChangeIntl(LanguageType eLnge)
{
ActLnge = eLnge;
- aLocale = MsLangId::convertLanguageToLocale( eLnge );
+ aLocale = LanguageTag( eLnge ).getLocale();
pCharClass->setLocale( aLocale );
xLocaleData.changeLocale( aLocale, eLnge );
xCalendar.changeLocale( aLocale );
@@ -1919,7 +1919,7 @@ String SvNumberFormatter::GetFormatDecimalSep( sal_uInt32 nFormat ) const
else
{
::com::sun::star::lang::Locale aSaveLocale( xLocaleData->getLocale() );
- ::com::sun::star::lang::Locale aTmpLocale(MsLangId::convertLanguageToLocale(pFormat->GetLanguage()));
+ ::com::sun::star::lang::Locale aTmpLocale( LanguageTag( pFormat->GetLanguage()).getLocale());
((SvNumberFormatter*)this)->xLocaleData.changeLocale(aTmpLocale, pFormat->GetLanguage() );
aRet = xLocaleData->getNumDecimalSep();
((SvNumberFormatter*)this)->xLocaleData.changeLocale( aSaveLocale, eSaveLang );
@@ -3547,7 +3547,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
LanguageType eSysLang = SvtSysLocale().GetLanguage();
LocaleDataWrapper* pLocaleData = new LocaleDataWrapper(
::comphelper::getProcessComponentContext(),
- MsLangId::convertLanguageToLocale( eSysLang ) );
+ LanguageTag( eSysLang ).getLocale() );
// get user configured currency
String aConfiguredCurrencyAbbrev;
LanguageType eConfiguredCurrencyLanguage = LANGUAGE_SYSTEM;
@@ -3573,8 +3573,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
sal_uInt16 nLegacyOnlyCurrencyPos = 0;
for ( sal_Int32 nLocale = 0; nLocale < nLocaleCount; nLocale++ )
{
- LanguageType eLang = MsLangId::convertLocaleToLanguage(
- pLocales[nLocale]);
+ LanguageType eLang = LanguageTag( pLocales[nLocale]).getLanguageType( false);
rInstalledLocales.insert( eLang);
pLocaleData->setLocale( pLocales[nLocale] );
Sequence< Currency2 > aCurrSeq = pLocaleData->getAllCurrencies();
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index bdb75ea..2b0fd8e 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -4774,7 +4774,7 @@ OUString SvNumberformat::impTransliterateImpl(const OUString& rStr,
const SvNumberNatNum& rNum ) const
{
com::sun::star::lang::Locale aLocale(
- MsLangId::convertLanguageToLocale( rNum.GetLang() ) );
+ LanguageTag( rNum.GetLang() ).getLocale() );
return GetFormatter().GetNatNum()->getNativeNumberString( rStr,
aLocale, rNum.GetNatNum() );
}
@@ -4789,7 +4789,7 @@ void SvNumberformat::GetNatNumXml(
if ( rNum.IsSet() )
{
com::sun::star::lang::Locale aLocale(
- MsLangId::convertLanguageToLocale( rNum.GetLang() ) );
+ LanguageTag( rNum.GetLang() ).getLocale() );
rAttr = GetFormatter().GetNatNum()->convertToXmlAttributes(
aLocale, rNum.GetNatNum() );
}
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 243bd2a..b3a0426 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -222,7 +222,7 @@ void ImpSvNumberformatScan::SetDependentKeywords()
// #80023# be sure to generate keywords for the loaded Locale, not for the
// requested Locale, otherwise number format codes might not match
lang::Locale aLoadedLocale = pLocaleData->getLoadedLocale();
- LanguageType eLang = MsLangId::convertLocaleToLanguage( aLoadedLocale );
+ LanguageType eLang = LanguageTag( aLoadedLocale ).getLanguageType( false);
NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(pFormatter->GetServiceManager()), aLoadedLocale );
i18n::NumberFormatCode aFormat = aNumberFormatCode.getFormatCode( NF_NUMBER_STANDARD );
commit e055182f274228c368503195745096c020c58ee2
Author: Eike Rathke <erack at redhat.com>
Date: Fri Nov 16 15:23:54 2012 +0100
use LanguageTag
Change-Id: I5138eb613ba78c2bc876e45e6845eef4d1212314
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 50179ea..2f35eef 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -37,6 +37,7 @@
#include <sal/log.hxx>
#include <rtl/instance.hxx>
#include <rtl/bootstrap.hxx>
+#include <i18npool/languagetag.hxx>
#include <i18npool/mslangid.hxx>
#include <tools/simplerm.hxx>
@@ -249,7 +250,7 @@ void ResMgrContainer::init()
// set default language
LanguageType nLang = MsLangId::getSystemUILanguage();
- MsLangId::convertLanguageToLocale(nLang, m_aDefLocale);
+ m_aDefLocale = LanguageTag( nLang).getLocale();
}
namespace
More information about the Libreoffice-commits
mailing list