diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-10-01 09:09:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-10-11 14:22:22 +0200 |
commit | 4f5b3e4bd53d6d61df1f65f496f7bc8dc525c8a1 (patch) | |
tree | e0ac44b8f22f944f3303bac8e494da41d6c7b164 /svl | |
parent | 5f84c44e3d5ff19b800b6358e61228546e318d4f (diff) |
In O[U]StringBuffer, make string_view params replacements for OUString ones
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That
way, loplugin:bufferadd and loplugin:stringviewparam found many further
opportunities for simplification (all addressed here). Some notes:
* There is no longer an implicit conversion from O[U]String to O[U]StringBuffer
(as that goes via user-defined conversions through string_view now), which was
most noticeable in copy initializations like
OStringBuffer buf = someStr;
that had to be changed to direct initialization,
OStringBuffer buf(someStr);
But then again, it wasn't too many places that were affected and I think we can
live with that.
* I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to
get them in line with their counterparts taking O[U]String.
* I added an OUStringBuffer::lastIndexOf string_view overload that was missing
(relative to OUStringBuffer::indexOf).
* loplugin:stringconstant needed some addition to keep the
compilerplugins/clang/test/stringconstant.cxx checks related to
OStringBuffer::append and OStringBuffer::insert working.
* loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related
code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea
"loplugin:stringviewparam extend to new.."
Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 6ecf548c0863..ed3499210e02 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1082,7 +1082,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge ) const LanguageTag& rLoadedLocale = xLocaleData->getLoadedLanguageTag(); if ( !rLoadedLocale.equals( maLanguageTag ) ) { - LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( "SvNumberFormatter::ImpGenerateCL: locales don't match:" )); + LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( u"SvNumberFormatter::ImpGenerateCL: locales don't match:" )); } // test XML locale data FormatElement entries { @@ -2468,7 +2468,7 @@ void SvNumberFormatter::ImpAdjustFormatCodeDefault( aMsg.append("\nXML locale data FormatElement group of: "); OUString aUMsg(OStringToOUString(aMsg.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US)); LocaleDataWrapper::outputCheckMessage( - xLocaleData->appendLocaleInfo(aUMsg + pFormatArr[0].NameID)); + xLocaleData->appendLocaleInfo(OUStringConcatenation(aUMsg + pFormatArr[0].NameID))); } } // find the default (medium preferred, then long) and reset all other defaults @@ -2583,7 +2583,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio if (LocaleDataWrapper::areChecksEnabled() && pStdFormat->GetType() != SvNumFormatType::NUMBER) { LocaleDataWrapper::outputCheckMessage( xLocaleData-> - appendLocaleInfo( "SvNumberFormatter::ImpGenerateFormats: General format not NUMBER")); + appendLocaleInfo( u"SvNumberFormatter::ImpGenerateFormats: General format not NUMBER")); } pStdFormat->SetType( SvNumFormatType::NUMBER ); pStdFormat->SetStandard(); @@ -2594,7 +2594,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio if (LocaleDataWrapper::areChecksEnabled()) { LocaleDataWrapper::outputCheckMessage( xLocaleData-> - appendLocaleInfo( "SvNumberFormatter::ImpGenerateFormats: General format not insertable, nothing will work")); + appendLocaleInfo( u"SvNumberFormatter::ImpGenerateFormats: General format not insertable, nothing will work")); } } @@ -3226,7 +3226,7 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, } else if (eType == SvNumFormatType::SCIENTIFIC) { - OUStringBuffer sOldFormatString = pFormat->GetFormatstring(); + OUStringBuffer sOldFormatString(pFormat->GetFormatstring()); sal_Int32 nIndexE = ImpPosToken( sOldFormatString, 'E' ); if (nIndexE > -1) { @@ -4059,7 +4059,7 @@ void SvNumberFormatter::GetCompatibilityCurrency( OUString& rSymbol, OUString& r if (LocaleDataWrapper::areChecksEnabled()) { LocaleDataWrapper::outputCheckMessage( xLocaleData-> - appendLocaleInfo( "GetCompatibilityCurrency: none?")); + appendLocaleInfo( u"GetCompatibilityCurrency: none?")); } rSymbol = xLocaleData->getCurrSymbol(); rAbbrev = xLocaleData->getCurrBankSymbol(); |