diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-06 23:00:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-09 13:28:37 +0000 |
commit | 45b19123a63f23fe37b11b063d7567bf79ef09aa (patch) | |
tree | befd8c637ac6fbdf94c05bb80c500fb781dd2bb4 /basic | |
parent | bcd9122715c7b708a65bee05a90dba3a38624ecb (diff) |
simplify CharClass
multiple variants of toUpper (etc)
some that take a non-const OUString or String and modify it
some that take a const OUString or String and return a new one
some that take part of a const OUString or String and return a new one
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/methods.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 34a453acda29..3ac11152b4ee 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -158,7 +158,7 @@ static long GetDayDiff( const Date& rDate ) return nDiffDays; } -static CharClass& GetCharClass( void ) +static const CharClass& GetCharClass( void ) { static sal_Bool bNeedsInit = sal_True; static ::com::sun::star::lang::Locale aLocale; @@ -1136,9 +1136,9 @@ RTLFUNC(LCase) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - CharClass& rCharClass = GetCharClass(); + const CharClass& rCharClass = GetCharClass(); String aStr( rPar.Get(1)->GetString() ); - rCharClass.toLower( aStr ); + aStr = rCharClass.lowercase(aStr); rPar.Get(0)->PutString( aStr ); } } @@ -1681,9 +1681,9 @@ RTLFUNC(UCase) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - CharClass& rCharClass = GetCharClass(); + const CharClass& rCharClass = GetCharClass(); String aStr( rPar.Get(1)->GetString() ); - rCharClass.toUpper( aStr ); + aStr = rCharClass.uppercase( aStr ); rPar.Get(0)->PutString( aStr ); } } @@ -3907,8 +3907,8 @@ RTLFUNC(StrConv) sal_Int32 nType = 0; if ( (nConversion & 0x03) == 3 ) // vbProperCase { - CharClass& rCharClass = GetCharClass(); - aOldStr = rCharClass.toTitle( aOldStr.ToLowerAscii(), 0, nOldLen ); + const CharClass& rCharClass = GetCharClass(); + aOldStr = rCharClass.titlecase( aOldStr.ToLowerAscii(), 0, nOldLen ); } else if ( (nConversion & 0x01) == 1 ) // vbUpperCase nType |= ::com::sun::star::i18n::TransliterationModules_LOWERCASE_UPPERCASE; |