diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-05-13 11:57:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-05-14 13:11:50 +0200 |
commit | af16aa625682b649e8843237652b9246d519cbae (patch) | |
tree | 2ea597c328318d6b75761b71af313bef02b5ad77 /basic | |
parent | f40cbba63f13e7081fc5901769651fd4d43ea34d (diff) |
Improve loplugin:stringview
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for
operator call arguments. (The "rather than copy, pass subView()" diagnostic is
already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly
for operator call arguments.)
(And many call sites don't even require an explicit [u16]string_view, esp. with
the recent ad48b2b02f83eed41fb1eb8d16de7e804156fcf1 "Optimized OString operator
+= overloads". Just some test code in sal/qa/ that explicitly tests the
O[U]String functionality had to be excluded.)
Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/iosys.cxx | 4 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 0cf83c509a39..5b177b906d2d 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -530,7 +530,7 @@ ErrCode const & SbiStream::Read( char& ch ) if (aLine.isEmpty()) { Read( aLine ); - aLine += OString('\n'); + aLine += "\n"; } ch = aLine[0]; aLine = aLine.copy(1); @@ -724,7 +724,7 @@ char SbiIoSystem::Read() if( aIn.isEmpty() ) { ReadCon( aIn ); - aIn += OString('\n'); + aIn += "\n"; } ch = aIn[0]; aIn = aIn.copy(1); diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index b82cf7b5f8a1..385f67540b37 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -2737,12 +2737,12 @@ void SbiRuntime::StepWRITE() // write TOS OUString s; if( ch ) { - s += OUString(ch); + s += OUStringChar(ch); } s += p->GetOUString(); if( ch ) { - s += OUString(ch); + s += OUStringChar(ch); } pIosys->Write( s ); Error( pIosys->GetError() ); |