summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2006-04-07 15:29:50 +0000
committerVladimir Glazounov <vg@openoffice.org>2006-04-07 15:29:50 +0000
commit6438993691fe34fc513c04b1cc9347985ba6ad65 (patch)
tree98c29a1216b63de09802c0ba7c338ecbc0090af3 /unotools
parent460b519d21413349e3d9707fe09abcb892fd3663 (diff)
INTEGRATION: CWS internatiodel (1.29.56); FILE MERGED
2006/02/10 19:32:56 er 1.29.56.4: #i52115# move LangIDs and ISO conversion from tools to i18npool; introduce class MsLangId and libi18nisolang 2006/01/19 14:30:31 er 1.29.56.3: RESYNC: (1.30-1.32); FILE MERGED 2005/06/27 10:45:55 er 1.29.56.2: RESYNC: (1.29-1.30); FILE MERGED 2005/06/24 13:13:52 er 1.29.56.1: #i50205# get rid of class International
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx74
1 files changed, 61 insertions, 13 deletions
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 147a8209c79a..3b1bea36409a 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: localedatawrapper.cxx,v $
*
- * $Revision: 1.32 $
+ * $Revision: 1.33 $
*
- * last change: $Author: rt $ $Date: 2005-09-09 09:44:40 $
+ * last change: $Author: vg $ $Date: 2006-04-07 16:29:50 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -46,8 +46,8 @@
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
-#ifndef _ISOLANG_HXX
-#include <tools/isolang.hxx>
+#ifndef INCLUDED_I18NPOOL_MSLANGID_HXX
+#include <i18npool/mslangid.hxx>
#endif
#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
@@ -210,6 +210,7 @@ void LocaleDataWrapper::invalidateData()
}
bReservedWordValid = FALSE;
}
+ xDefaultCalendar = NULL;
// dummies
cCurrZeroChar = '0';
}
@@ -469,8 +470,7 @@ void LocaleDataWrapper::invalidateData()
}
continue;
}
- LanguageType eLang = ConvertIsoNamesToLanguage( xLoc[i].Language,
- xLoc[i].Country );
+ LanguageType eLang = MsLangId::convertLocaleToLanguage( xLoc[i] );
// In checks, exclude known problems because no MS-LCID defined.
if (areChecksEnabled() && eLang == LANGUAGE_DONTKNOW
@@ -491,10 +491,10 @@ void LocaleDataWrapper::invalidateData()
}
if ( eLang != LANGUAGE_DONTKNOW )
{
- String aLanguage, aCountry;
- ConvertLanguageToIsoNames( eLang, aLanguage, aCountry );
- if ( String( xLoc[i].Language ) != aLanguage ||
- String( xLoc[i].Country ) != aCountry )
+ rtl::OUString aLanguage, aCountry;
+ MsLangId::convertLanguageToIsoNames( eLang, aLanguage, aCountry );
+ if ( xLoc[i].Language != aLanguage ||
+ xLoc[i].Country != aCountry )
{
// In checks, exclude known problems because no MS-LCID defined
// and default for Language found.
@@ -511,11 +511,11 @@ void LocaleDataWrapper::invalidateData()
aMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " -> 0x" ) );
aMsg += String::CreateFromInt32( eLang, 16 );
aMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " -> " ) );
- aMsg += aLanguage;
- if ( aCountry.Len() )
+ aMsg += String( aLanguage);
+ if ( aCountry.getLength() )
{
aMsg += '_';
- aMsg += aCountry;
+ aMsg += String( aCountry);
}
outputCheckMessage( aMsg );
}
@@ -655,6 +655,54 @@ MeasurementSystem LocaleDataWrapper::mapMeasurementStringToEnum( const String& r
}
+void LocaleDataWrapper::getDefaultCalendarImpl()
+{
+ if (!xDefaultCalendar.is())
+ {
+ Sequence< Calendar > xCals = getAllCalendars();
+ sal_Int32 nCount = xCals.getLength();
+ sal_Int32 nDef = 0;
+ if (nCount > 1)
+ {
+ const Calendar* pArr = xCals.getArray();
+ for (sal_Int32 i=0; i<nCount; ++i)
+ {
+ if (pArr[i].Default)
+ {
+ nDef = i;
+ break;
+ }
+ }
+ }
+ xDefaultCalendar = new Calendar( xCals[nDef]);
+ }
+}
+
+
+const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::Calendar > LocaleDataWrapper::getDefaultCalendar() const
+{
+ ::utl::ReadWriteGuard aGuard( aMutex );
+ if (!xDefaultCalendar.is())
+ { // no cached content
+ aGuard.changeReadToWrite();
+ ((LocaleDataWrapper*)this)->getDefaultCalendarImpl();
+ }
+ return xDefaultCalendar;
+}
+
+
+const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > LocaleDataWrapper::getDefaultCalendarDays() const
+{
+ return getDefaultCalendar()->Days;
+}
+
+
+const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > LocaleDataWrapper::getDefaultCalendarMonths() const
+{
+ return getDefaultCalendar()->Months;
+}
+
+
// --- currencies -----------------------------------------------------
const String& LocaleDataWrapper::getCurrSymbol() const