diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-27 09:37:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-27 13:31:20 +0200 |
commit | 0a7eac8576f313dcaf27ee45326d71fd6b5aea1e (patch) | |
tree | 1af6ac4da7b61da0eb5b1a68cc2d7a7491ec1f24 /basic | |
parent | 322ea272bba63ba779120ca5ead4a4b40d1bb93f (diff) |
use more string_view in accessibility..configmgr
Change-Id: Ie16d36faac7d06e275348ed68e6c6b2518534fd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140636
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/inc/sbxform.hxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxform.cxx | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/basic/inc/sbxform.hxx b/basic/inc/sbxform.hxx index c14d950a8f6b..49ef777866c0 100644 --- a/basic/inc/sbxform.hxx +++ b/basic/inc/sbxform.hxx @@ -116,7 +116,7 @@ class SbxBasicFormater { static OUString GetNegFormatString( std::u16string_view sFormatStrg, bool & bFound ); static OUString Get0FormatString( std::u16string_view sFormatStrg, bool & bFound ); static OUString GetNullFormatString( std::u16string_view sFormatStrg, bool & bFound ); - static void AnalyseFormatString( const OUString& sFormatStrg, + static void AnalyseFormatString( std::u16string_view sFormatStrg, short& nNoOfDigitsLeft, short& nNoOfDigitsRight, short& nNoOfOptionalDigitsLeft, short& nNoOfExponentDigits, @@ -124,7 +124,7 @@ class SbxBasicFormater { bool& bPercent, bool& bCurrency, bool& bScientific, bool& bGenerateThousandSeparator, short& nMultipleThousandSeparators ); - void ScanFormatString( double dNumber, const OUString& sFormatStrg, + void ScanFormatString( double dNumber, std::u16string_view sFormatStrg, OUString& sReturnStrg, bool bCreateSign ); //*** Data *** diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index bda6da33e248..76372bf23f2a 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -397,7 +397,7 @@ OUString SbxBasicFormater::GetNullFormatString( std::u16string_view sFormatStrg, } // returns value <> 0 in case of an error -void SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg, +void SbxBasicFormater::AnalyseFormatString( std::u16string_view sFormatStrg, short& nNoOfDigitsLeft, short& nNoOfDigitsRight, short& nNoOfOptionalDigitsLeft, short& nNoOfExponentDigits, short& nNoOfOptionalExponentDigits, @@ -408,7 +408,7 @@ void SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg, sal_Int32 nLen; short nState = 0; - nLen = sFormatStrg.getLength(); + nLen = sFormatStrg.size(); nNoOfDigitsLeft = 0; nNoOfDigitsRight = 0; nNoOfOptionalDigitsLeft = 0; @@ -419,7 +419,7 @@ void SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg, bScientific = false; // from 11.7.97: as soon as a comma (point?) is found in the format string, // all three decimal powers are marked (i. e. thousand, million, ...) - bGenerateThousandSeparator = sFormatStrg.indexOf( ',' ) >= 0; + bGenerateThousandSeparator = sFormatStrg.find( ',' ) != std::u16string_view::npos; nMultipleThousandSeparators = 0; for( sal_Int32 i = 0; i < nLen; i++ ) @@ -513,7 +513,7 @@ void SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg, // the flag bCreateSign says that at the mantissa a leading sign // shall be created void SbxBasicFormater::ScanFormatString( double dNumber, - const OUString& sFormatStrg, OUString& sReturnStrgFinal, + std::u16string_view sFormatStrg, OUString& sReturnStrgFinal, bool bCreateSign ) { short /*nErr,*/nNoOfDigitsLeft,nNoOfDigitsRight,nNoOfOptionalDigitsLeft, @@ -565,7 +565,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, bSignHappend = false; bFoundFirstDigit = false; bIsNegative = dNumber < 0.0; - nLen = sFormatStrg.getLength(); + nLen = sFormatStrg.size(); dExponent = get_number_of_digits( dNumber ); nExponentPos = 0; nMaxExponentDigit = 0; @@ -837,7 +837,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, if( nNoOfDigitsRight>0 ) { - ParseBack( sReturnStrg, sFormatStrg, sFormatStrg.getLength()-1 ); + ParseBack( sReturnStrg, sFormatStrg, sFormatStrg.size()-1 ); } sReturnStrgFinal = sReturnStrg.makeStringAndClear(); } |