diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-09-09 23:35:25 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-13 11:30:48 +0000 |
commit | 3e55e00662b50b02c289ca4a1d94d4306bd8c86b (patch) | |
tree | 8d8f33abc07e0f78bfcd8e291e81fcc307918912 /vcl | |
parent | really drop unused help id (diff) | |
download | core-3e55e00662b50b02c289ca4a1d94d4306bd8c86b.tar.gz core-3e55e00662b50b02c289ca4a1d94d4306bd8c86b.zip |
String to OUString
This removes nearly all ToLowerAscii() calls.
Conflicts:
linguistic/source/convdic.cxx
linguistic/source/convdiclist.cxx
linguistic/source/dlistimp.cxx
sc/source/filter/html/htmlexp.cxx
Change-Id: Iddcaacfb7383e1df3d2f13751a3c788eba953fdd
Reviewed-on: https://gerrit.libreoffice.org/5895
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/gdi/salgdi3.cxx | 21 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 12 |
2 files changed, 15 insertions, 18 deletions
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 09a907ab76da..5c0194703770 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -94,12 +94,12 @@ class ImplFontAttrCache { private: FontAttrMap aFontAttributes; - OUString aCacheFileName; - String aBaseURL; - sal_Bool bModified; + OUString aCacheFileName; + OUString aBaseURL; + sal_Bool bModified; protected: - String OptimizeURL( const String& rURL ) const; + OUString OptimizeURL( const OUString& rURL ) const; enum{ MAGIC = 0x12349876 }; // change if fontattrcache format changes @@ -111,10 +111,10 @@ public: void AddFontAttr( const String& rFontFileName, const ImplDevFontAttributes& ); }; -ImplFontAttrCache::ImplFontAttrCache( const String& rFileNameURL, const String& rBaseURL ) : aBaseURL( rBaseURL ) +ImplFontAttrCache::ImplFontAttrCache( const OUString& rFileNameURL, const OUString& rBaseURL ) : aBaseURL( rBaseURL ) { bModified = FALSE; - aBaseURL.ToLowerAscii(); // Windows only, no problem... + aBaseURL = aBaseURL.toAsciiLowerCase(); // Windows only, no problem... // open the cache file osl::FileBase::getSystemPathFromFileURL( rFileNameURL, aCacheFileName ); @@ -190,12 +190,11 @@ ImplFontAttrCache::~ImplFontAttrCache() } } -String ImplFontAttrCache::OptimizeURL( const String& rURL ) const +OUString ImplFontAttrCache::OptimizeURL( const OUString& rURL ) const { - String aOptimizedFontFileURL( rURL ); - aOptimizedFontFileURL.ToLowerAscii(); // Windows only, no problem... - if ( aOptimizedFontFileURL.CompareTo( aBaseURL, aBaseURL.Len() ) == COMPARE_EQUAL ) - aOptimizedFontFileURL = aOptimizedFontFileURL.Copy( aBaseURL.Len() ); + OUString aOptimizedFontFileURL( rURL.toAsciiLowerCase() ); + if ( aOptimizedFontFileURL.startsWith( aBaseURL ) ) + aOptimizedFontFileURL = aOptimizedFontFileURL.copy( aBaseURL.getLength() ); return aOptimizedFontFileURL; } diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 9b4e12ca05cc..95f88aa72757 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -4613,10 +4613,8 @@ static int ImplMenuChar( HWND, WPARAM wParam, LPARAM lParam ) { int nRet = MNC_IGNORE; HMENU hMenu = (HMENU) lParam; - String aMnemonic; - aMnemonic.AssignAscii("&"); - aMnemonic.Append( (sal_Unicode) LOWORD(wParam) ); - aMnemonic.ToLowerAscii(); // we only have ascii mnemonics + OUString aMnemonic( "&" + (sal_Unicode) LOWORD(wParam) ); + aMnemonic = aMnemonic.toAsciiLowerCase(); // we only have ascii mnemonics // search the mnemonic in the current menu int nItemCount = GetMenuItemCount( hMenu ); @@ -4629,9 +4627,9 @@ static int ImplMenuChar( HWND, WPARAM wParam, LPARAM lParam ) WinSalMenuItem* pSalMenuItem = ImplGetSalMenuItem( hMenu, idx % nItemCount ); if( !pSalMenuItem ) continue; - String aStr = pSalMenuItem->mText; - aStr.ToLowerAscii(); - if( aStr.Search( aMnemonic ) != STRING_NOTFOUND) + OUString aStr = pSalMenuItem->mText; + aStr = aStr.toAsciiLowerCase(); + if( aStr.indexOf( aMnemonic ) != -1 ) { if( idxFound == -1 ) idxFound = idx % nItemCount; |