summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
parent37f5b864014e9ad17a561b77ea9f6141650e92ad (diff)
some i18n wrappers with LanguageTag
Change-Id: I2ceaa3159e8669c2c569fa8559c1e061dcad399d
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svtools/source/control/calendar.cxx12
-rw-r--r--svtools/source/control/ctrlbox.cxx2
-rw-r--r--svtools/source/control/fmtfield.cxx18
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx2
5 files changed, 16 insertions, 20 deletions
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 1f02aff742a3..988827772174 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1710,7 +1710,7 @@ SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommand
,mbReplaceNames ( sal_False )
,mnSuspendSelectCallback ( 0 )
,mbIsFirstResort ( sal_True )
- ,aIntlWrapper ( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag().getLocale() )
+ ,aIntlWrapper ( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLanguageTag() )
,maFolderImage ( SvtResId( IMG_SVT_FOLDER ) )
,mxCmdEnv ( xEnv )
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 907ff5bc2b5e..2712871324e6 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -195,24 +195,18 @@ void Calendar::ImplInit( WinBits nWinStyle )
::rtl::OUString aGregorian( RTL_CONSTASCII_USTRINGPARAM( "gregorian"));
maCalendarWrapper.loadCalendar( aGregorian,
- Application::GetAppLocaleDataWrapper().getLocale());
+ Application::GetAppLocaleDataWrapper().getLanguageTag().getLocale());
if (maCalendarWrapper.getUniqueID() != aGregorian)
{
-#ifdef SAL_LOG_WARN
- lang::Locale aLoc( Application::GetAppLocaleDataWrapper().getLocale() );
SAL_WARN( "svtools.control", "Calendar::ImplInit: No ``gregorian'' calendar available for locale ``"
- << aLoc.Language << "-" << aLoc.Country
+ << Application::GetAppLocaleDataWrapper().getLanguageTag().getBcp47()
<< "'' and other calendars aren't supported. Using en-US fallback." );
-#endif
/* If we ever wanted to support other calendars than Gregorian a lot of
* rewrite would be necessary to internally replace use of class Date
* with proper class CalendarWrapper methods, get rid of fixed 12
* months, fixed 7 days, ... */
- maCalendarWrapper.loadCalendar( aGregorian, lang::Locale(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "en")),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "US")),
- ::rtl::OUString()));
+ maCalendarWrapper.loadCalendar( aGregorian, lang::Locale( "en", "US", ""));
}
SetFirstDate( maCurDate );
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 4a2c156e2d91..017422f0ea75 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1460,7 +1460,7 @@ void FontStyleBox::LoseFocus()
void FontStyleBox::Modify()
{
CharClass aChrCls( ::comphelper::getProcessComponentContext(),
- GetSettings().GetLanguageTag().getLocale() );
+ GetSettings().GetLanguageTag() );
XubString aStr = GetText();
sal_uInt16 nEntryCount = GetEntryCount();
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index cf73f480ccfe..375a3f6edc46 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -284,8 +284,7 @@ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
if (!s_cFormatter)
{
// get the Office's locale and translate
- LanguageType eSysLanguage = LanguageTag(
- SvtSysLocale().GetLocaleData().getLocale()).getLanguageType( false);
+ LanguageType eSysLanguage = SvtSysLocale().GetLanguageTag().getLanguageType( false);
s_cFormatter = new SvNumberFormatter(
::comphelper::getProcessServiceFactory(),
eSysLanguage);
@@ -618,8 +617,7 @@ void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, sal_Bool bReset
if ( m_pFormatter )
{
// get the Office's locale and translate
- LanguageType eSysLanguage = LanguageTag(
- SvtSysLocale().GetLocaleData().getLocale()).getLanguageType( false);
+ LanguageType eSysLanguage = SvtSysLocale().GetLanguageTag().getLanguageType( false);
// get the standard numeric format for this language
m_nFormatKey = m_pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, eSysLanguage );
}
@@ -1152,8 +1150,7 @@ void DoubleNumericField::ResetConformanceTester()
sal_Unicode cSeparatorDecimal = '.';
if (pFormatEntry)
{
- Locale aLocale( LanguageTag( pFormatEntry->GetLanguage()).getLocale());
- LocaleDataWrapper aLocaleInfo( aLocale );
+ LocaleDataWrapper aLocaleInfo( LanguageTag( pFormatEntry->GetLanguage()) );
String sSeparator = aLocaleInfo.getNumThousandSep();
if (sSeparator.Len())
@@ -1243,8 +1240,13 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
sal_uInt16 nDigits = GetDecimalDigits();
// build a new format string with the base class' and my own settings
- Locale aLocale( LanguageTag( eLanguage).getLocale());
- LocaleDataWrapper aLocaleInfo( aLocale );
+
+ /* Strangely with gcc 4.6.3 this needs a temporary LanguageTag, otherwise
+ * there's
+ * error: request for member ‘getNumThousandSep’ in ‘aLocaleInfo’, which is
+ * of non-class type ‘LocaleDataWrapper(LanguageTag)’ */
+ LanguageTag aLanguageTag( eLanguage);
+ LocaleDataWrapper aLocaleInfo( aLanguageTag );
XubString sNewFormat;
if (bThSep)
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index 2efa5a96d93f..7db7b722b660 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -330,7 +330,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c )
{
static CharClass* pCharClass = NULL;
if( pCharClass == NULL )
- pCharClass = new CharClass( Application::GetSettings().GetLanguageTag().getLocale() );
+ pCharClass = new CharClass( Application::GetSettings().GetLanguageTag() );
rtl::OUString aStr( c );
bool bRet = pCharClass->isLetter( aStr, 0 );
return bRet;