Kaydet (Commit) ee30270f authored tarafından Eike Rathke's avatar Eike Rathke

use LanguageTag

Change-Id: I1d7ba0066ab871ac471a57bbbf0bbf07bc6350cc
üst 4b4cbca6
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx>
#include <i18npool/mslangid.hxx> #include <i18npool/languagetag.hxx>
#include <sal/main.h> #include <sal/main.h>
#include <svtools/langtab.hxx> #include <svtools/langtab.hxx>
#include <tools/extendapplicationenvironment.hxx> #include <tools/extendapplicationenvironment.hxx>
...@@ -76,14 +76,7 @@ SAL_IMPLEMENT_MAIN() ...@@ -76,14 +76,7 @@ SAL_IMPLEMENT_MAIN()
continue; continue;
} }
lang::Locale aLocale; rtl::OUString sTag( LanguageTag( eLang).getBcp47());
MsLangId::convertLanguageToLocale(eLang, aLocale);
rtl::OUStringBuffer aBuf(aLocale.Language);
if (!aLocale.Country.isEmpty())
aBuf.append('-').append(aLocale.Country);
rtl::OUString sTag = aBuf.makeStringAndClear();
std::cout << rtl::OUStringToOString(sTag, osl_getThreadTextEncoding()).getStr() std::cout << rtl::OUStringToOString(sTag, osl_getThreadTextEncoding()).getStr()
<< std::endl; << std::endl;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <svl/zformat.hxx> #include <svl/zformat.hxx>
#include <svtools/fmtfield.hxx> #include <svtools/fmtfield.hxx>
#include <i18npool/mslangid.hxx> #include <i18npool/languagetag.hxx>
#include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/util/SearchAlgorithms.hpp> #include <com/sun/star/util/SearchAlgorithms.hpp>
...@@ -293,8 +293,8 @@ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter() ...@@ -293,8 +293,8 @@ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
if (!s_cFormatter) if (!s_cFormatter)
{ {
// get the Office's locale and translate // get the Office's locale and translate
LanguageType eSysLanguage = MsLangId::convertLocaleToLanguage( LanguageType eSysLanguage = LanguageTag(
SvtSysLocale().GetLocaleData().getLocale() ); SvtSysLocale().GetLocaleData().getLocale()).getLanguageType( false);
s_cFormatter = new SvNumberFormatter( s_cFormatter = new SvNumberFormatter(
::comphelper::getProcessServiceFactory(), ::comphelper::getProcessServiceFactory(),
eSysLanguage); eSysLanguage);
...@@ -619,8 +619,8 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset ...@@ -619,8 +619,8 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset
if ( m_pFormatter ) if ( m_pFormatter )
{ {
// get the Office's locale and translate // get the Office's locale and translate
LanguageType eSysLanguage = MsLangId::convertLocaleToLanguage( LanguageType eSysLanguage = LanguageTag(
SvtSysLocale().GetLocaleData().getLocale() ); SvtSysLocale().GetLocaleData().getLocale()).getLanguageType( false);
// get the standard numeric format for this language // get the standard numeric format for this language
m_nFormatKey = m_pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, eSysLanguage ); m_nFormatKey = m_pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, eSysLanguage );
} }
...@@ -1144,8 +1144,7 @@ void DoubleNumericField::ResetConformanceTester() ...@@ -1144,8 +1144,7 @@ void DoubleNumericField::ResetConformanceTester()
sal_Unicode cSeparatorDecimal = '.'; sal_Unicode cSeparatorDecimal = '.';
if (pFormatEntry) if (pFormatEntry)
{ {
Locale aLocale; Locale aLocale( LanguageTag( pFormatEntry->GetLanguage()).getLocale());
MsLangId::convertLanguageToLocale( pFormatEntry->GetLanguage(), aLocale );
LocaleDataWrapper aLocaleInfo( aLocale ); LocaleDataWrapper aLocaleInfo( aLocale );
String sSeparator = aLocaleInfo.getNumThousandSep(); String sSeparator = aLocaleInfo.getNumThousandSep();
...@@ -1236,8 +1235,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat() ...@@ -1236,8 +1235,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
sal_uInt16 nDigits = GetDecimalDigits(); sal_uInt16 nDigits = GetDecimalDigits();
// build a new format string with the base class' and my own settings // build a new format string with the base class' and my own settings
Locale aLocale; Locale aLocale( LanguageTag( eLanguage).getLocale());
MsLangId::convertLanguageToLocale( eLanguage, aLocale );
LocaleDataWrapper aLocaleInfo( aLocale ); LocaleDataWrapper aLocaleInfo( aLocale );
XubString sNewFormat; XubString sNewFormat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment