diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-17 18:46:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-19 17:46:39 +0100 |
commit | 3fd6e05a77e0e9ca1db6c7f9e5a1b17d32250b36 (patch) | |
tree | 6da94bcdd547529fdf8ba60924283d14b45d53b2 /vcl | |
parent | 35d9ce88107f860e1a358c5273087985689a22c0 (diff) |
osl::Mutex->std::mutex in I18nHelper
Change-Id: I8743755992eeb78ec213cb51913da1b66b712142
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127069
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/i18nhelp.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx index 8bf77ac25116..1cff03689ec5 100644 --- a/vcl/source/app/i18nhelp.cxx +++ b/vcl/source/app/i18nhelp.cxx @@ -106,7 +106,7 @@ OUString vcl::I18nHelper::filterFormattingChars( const OUString& rStr ) sal_Int32 vcl::I18nHelper::CompareString( const OUString& rStr1, const OUString& rStr2 ) const { - ::osl::Guard< ::osl::Mutex > aGuard( const_cast<vcl::I18nHelper*>(this)->maMutex ); + std::unique_lock aGuard( maMutex ); if ( mbTransliterateIgnoreCase ) { @@ -123,7 +123,7 @@ sal_Int32 vcl::I18nHelper::CompareString( const OUString& rStr1, const OUString& bool vcl::I18nHelper::MatchString( const OUString& rStr1, const OUString& rStr2 ) const { - ::osl::Guard< ::osl::Mutex > aGuard( const_cast<vcl::I18nHelper*>(this)->maMutex ); + std::unique_lock aGuard( maMutex ); if ( !mbTransliterateIgnoreCase ) { @@ -140,16 +140,11 @@ bool vcl::I18nHelper::MatchString( const OUString& rStr1, const OUString& rStr2 bool vcl::I18nHelper::MatchMnemonic( const OUString& rString, sal_Unicode cMnemonicChar ) const { - ::osl::Guard< ::osl::Mutex > aGuard( const_cast<vcl::I18nHelper*>(this)->maMutex ); - - bool bEqual = false; sal_Int32 n = rString.indexOf( '~' ); - if ( n != -1 ) - { - OUString aMatchStr = rString.copy( n+1 ); // not only one char, because of transliteration... - bEqual = MatchString( OUString(cMnemonicChar), aMatchStr ); - } - return bEqual; + if ( n == -1 ) + return false; + OUString aMatchStr = rString.copy( n+1 ); // not only one char, because of transliteration... + return MatchString( OUString(cMnemonicChar), aMatchStr ); } OUString vcl::I18nHelper::GetNum( tools::Long nNumber, sal_uInt16 nDecimals, bool bUseThousandSep, bool bTrailingZeros ) const |