summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-05-13 11:57:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-05-14 13:11:50 +0200
commitaf16aa625682b649e8843237652b9246d519cbae (patch)
tree2ea597c328318d6b75761b71af313bef02b5ad77 /sal
parentf40cbba63f13e7081fc5901769651fd4d43ea34d (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 'sal')
-rw-r--r--sal/qa/osl/file/osl_File.cxx6
-rw-r--r--sal/qa/rtl/strings/test_oustring_convert.cxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index b83dbb3b821a..e4c595a6f0f7 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -4705,7 +4705,7 @@ namespace osl_Directory
OString tmp_x(OUStringToOString(system_path, RTL_TEXTENCODING_UTF8));
if (tmp_x.lastIndexOf('/') != (tmp_x.getLength() - 1))
- tmp_x += OString('/');
+ tmp_x += "/";
#if !defined(_WIN32) && !defined(ANDROID) && !defined(AIX)
// FIXME would be nice to create unique dir even on Windows
@@ -4718,9 +4718,9 @@ namespace osl_Directory
out != nullptr
);
- tmp_x += OString('/');
+ tmp_x += "/";
#endif
- tmp_x += OString(TEST_PATH_POSTFIX);
+ tmp_x += TEST_PATH_POSTFIX;
OUString tmpTestPath;
rc = osl::FileBase::getFileURLFromSystemPath(OStringToOUString(tmp_x, RTL_TEXTENCODING_UTF8), tmpTestPath);
diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx
index bfd1a2aac784..da930a03f244 100644
--- a/sal/qa/rtl/strings/test_oustring_convert.cxx
+++ b/sal/qa/rtl/strings/test_oustring_convert.cxx
@@ -90,7 +90,7 @@ void testConvertToString(TestConvertToString const & rTest)
}
else
{
- if (aStrict != OString(RTL_CONSTASCII_STRINGPARAM("12345")))
+ if (aStrict != "12345")
{
OStringBuffer aMessage(aPrefix);
aMessage.append("modified output");