summaryrefslogtreecommitdiff
path: root/vcl/source/app/i18nhelp.cxx
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2001-08-23 11:03:17 +0000
committerMalte Timmermann <mt@openoffice.org>2001-08-23 11:03:17 +0000
commitbc893e443ab60e32dfecd0e9ba28a0510fb43c15 (patch)
tree735bad12ebb66845409195fba431b173c8d27b44 /vcl/source/app/i18nhelp.cxx
parent02f8fe077b2bf0485133bd3934f557bb7a117c62 (diff)
#89855# More helper functions
Diffstat (limited to 'vcl/source/app/i18nhelp.cxx')
-rw-r--r--vcl/source/app/i18nhelp.cxx40
1 files changed, 34 insertions, 6 deletions
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 05831070ccdb..824670231609 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: i18nhelp.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: mt $ $Date: 2001-08-08 10:31:49 $
+ * last change: $Author: mt $ $Date: 2001-08-23 12:03:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,11 +136,36 @@ utl::TransliterationWrapper& vcl::I18nHelper::ImplGetTransliterationWrapper() co
return *mpTransliterationWrapper;
}
+LocaleDataWrapper& vcl::I18nHelper::ImplGetLocaleDataWrapper() const
+{
+ if ( !mpLocaleDataWrapper )
+ {
+ ((vcl::I18nHelper*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( mxMSF, maLocale );
+ }
+ return *mpLocaleDataWrapper;
+}
+
const ::com::sun::star::lang::Locale& vcl::I18nHelper::getLocale() const
{
return maLocale;
}
+sal_Int32 vcl::I18nHelper::CompareString( const String& rStr1, const String& rStr2 ) const
+{
+ ::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
+
+ if ( mbTransliterateIgnoreCase )
+ {
+ // Change mbTransliterateIgnoreCase and destroy the warpper, next call to
+ // ImplGetTransliterationWrapper() will create a wrapper with the correct bIgnoreCase
+ ((vcl::I18nHelper*)this)->mbTransliterateIgnoreCase = FALSE;
+ delete ((vcl::I18nHelper*)this)->mpTransliterationWrapper;
+ ((vcl::I18nHelper*)this)->mpTransliterationWrapper = NULL;
+ }
+
+ return ImplGetTransliterationWrapper().compareString( rStr1, rStr2 );
+}
+
sal_Bool vcl::I18nHelper::MatchString( const String& rStr1, const String& rStr2 ) const
{
::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
@@ -166,17 +191,20 @@ sal_Bool vcl::I18nHelper::MatchMnemonic( const String& rString, sal_Unicode cMne
if ( n != STRING_NOTFOUND )
{
String aMatchStr( rString, n+1, STRING_LEN ); // not only one char, because of transliteration...
- sal_Int32 nMatch1, nMatch2;
bEqual = MatchString( cMnemonicChar, aMatchStr );
}
return bEqual;
}
-String vcl::I18nHelper::GetDate( const Date& rDate, sal_Bool bLongFormat ) const
+String vcl::I18nHelper::GetDate( const Date& rDate ) const
{
::osl::Guard< ::osl::Mutex > aGuard( ((vcl::I18nHelper*)this)->maMutex );
- // !!!!!!!!!!!!!!!!!!!!!!!!!!!!
- return String();
+ return ImplGetLocaleDataWrapper().getDate( rDate );
+}
+
+String vcl::I18nHelper::GetNum( long nNumber, USHORT nDecimals, BOOL bUseThousandSep, BOOL bTrailingZeros ) const
+{
+ return ImplGetLocaleDataWrapper().getNum( nNumber, nDecimals, bUseThousandSep, bTrailingZeros );
}