diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 17:44:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 21:25:10 +0100 |
commit | 35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch) | |
tree | bb78f4f13f131f0cb206a9707cc3cfc495a3876a /svtools | |
parent | 0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (diff) |
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by
1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).
This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).
The improvement to loplugin:stringadd became necessary to fix
> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.
Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/qa/unit/testHtmlWriter.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/ctrltool.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 2 | ||||
-rw-r--r-- | svtools/source/svhtml/HtmlWriter.cxx | 2 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlout.cxx | 6 | ||||
-rw-r--r-- | svtools/source/uno/wizard/unowizard.cxx | 5 |
6 files changed, 11 insertions, 8 deletions
diff --git a/svtools/qa/unit/testHtmlWriter.cxx b/svtools/qa/unit/testHtmlWriter.cxx index a041c24b8567..601287342c4b 100644 --- a/svtools/qa/unit/testHtmlWriter.cxx +++ b/svtools/qa/unit/testHtmlWriter.cxx @@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(Test, testAttributeValues) aHtml.prettyPrint(false); aHtml.start("abc"); aHtml.attribute("one", OString("one")); - aHtml.attribute("two", OUString("two")); + aHtml.attribute("two", u"two"); aHtml.attribute("three", sal_Int32(12)); aHtml.end(); diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index 8f07a60091c3..ac2332e3e1ec 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -832,7 +832,7 @@ FontSizeNames::FontSizeNames( LanguageType eLanguage ) } } -sal_Int32 FontSizeNames::Name2Size( const OUString& rName ) const +sal_Int32 FontSizeNames::Name2Size( std::u16string_view rName ) const { if ( mnElem ) { diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 4990b07654f1..8637ba8d9b33 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -1131,7 +1131,7 @@ void FilterMatch::createWildCardFilterList(const OUString& _rFilterList,::std::v else { // no filter is given -> match all - _rFilters.emplace_back("*" ); + _rFilters.emplace_back(u"*" ); } } diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx index 7414b40b15b5..ce398757b0d2 100644 --- a/svtools/source/svhtml/HtmlWriter.cxx +++ b/svtools/source/svhtml/HtmlWriter.cxx @@ -131,7 +131,7 @@ void HtmlWriter::attribute(const OString& aAttribute, const char* pValue) attribute(aAttribute, OString(pValue)); } -void HtmlWriter::attribute(const OString& aAttribute, const OUString& aValue) +void HtmlWriter::attribute(const OString& aAttribute, std::u16string_view aValue) { attribute(aAttribute, OUStringToOString(aValue, RTL_TEXTENCODING_UTF8)); } diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 24ce5b50b98e..c148f49dc92f 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -789,7 +789,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, const OUString& rBaseURL, - const OUString& rSource, + std::u16string_view rSource, const OUString& rLanguage, ScriptType eScriptType, const OUString& rSrc, @@ -846,7 +846,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, rStrm.WriteOString( sOut.makeStringAndClear() ); - if( !rSource.isEmpty() || pSBLibrary || pSBModule ) + if( !rSource.empty() || pSBLibrary || pSBModule ) { rStrm.WriteCharPtr( SAL_NEWLINE_STRING ); @@ -877,7 +877,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, } } - if( !rSource.isEmpty() ) + if( !rSource.empty() ) { // we write the module in ANSI-charset, but with // the system new line. diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index b92c4afafdae..ea028304737a 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> #include "wizardshell.hxx" @@ -138,7 +141,7 @@ namespace { { } - OUString lcl_getHelpURL( const OString& sHelpId ) + OUString lcl_getHelpURL( std::string_view sHelpId ) { OUStringBuffer aBuffer; OUString aTmp( |