summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-19 10:30:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-20 07:06:31 +0200
commit35948cad8d41c0e70debb442b8f6182b28f0a65a (patch)
tree639ac8a9ff3a67b58de050e369d85517aa34db65 /sal
parent64c47c92d09c276408405e2520328155dd665427 (diff)
Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: sal
Change-Id: If4a7951fd3f9f7f2e081e6b8ba482566260c3235 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158209 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/pipe.cxx4
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx8
-rw-r--r--sal/qa/rtl/digest/rtl_digest.cxx2
-rw-r--r--sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx16
-rw-r--r--sal/qa/rtl/process/rtl_Process.cxx4
-rw-r--r--sal/qa/rtl/textenc/rtl_textcvt.cxx2
6 files changed, 18 insertions, 18 deletions
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index 9aaa83bcb79e..43f577ba8f44 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -37,8 +37,8 @@
#include <sys/stat.h>
#include <unistd.h>
-constexpr OStringLiteral PIPEDEFAULTPATH = "/tmp";
-constexpr OStringLiteral PIPEALTERNATEPATH = "/var/tmp";
+constexpr OString PIPEDEFAULTPATH = "/tmp"_ostr;
+constexpr OString PIPEALTERNATEPATH = "/var/tmp"_ostr;
static oslPipe osl_psz_createPipe(const char *pszPipeName, oslPipeOptions Options, oslSecurity Security);
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index 39c9e99864f6..62463f8868dc 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -82,11 +82,11 @@ static void printPipeError( ::osl::Pipe const & aPipe )
// pipe name and transfer contents
-constexpr OUStringLiteral aTestPipeName(u"testpipe2");
-constexpr OUStringLiteral aTestPipe1(u"testpipe1");
+constexpr OUString aTestPipeName(u"testpipe2"_ustr);
+constexpr OUString aTestPipe1(u"testpipe1"_ustr);
-constexpr OStringLiteral m_pTestString1("Sun Microsystems");
-constexpr OStringLiteral m_pTestString2("test pipe PASS/OK");
+constexpr OString m_pTestString1("Sun Microsystems"_ostr);
+constexpr OString m_pTestString2("test pipe PASS/OK"_ostr);
// test code start here
diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx
index f62e951a7295..e259eead6a69 100644
--- a/sal/qa/rtl/digest/rtl_digest.cxx
+++ b/sal/qa/rtl/digest/rtl_digest.cxx
@@ -36,7 +36,7 @@ using namespace rtl;
namespace
{
-constexpr OStringLiteral sSampleString ("This is a sample sentence, which we use to check some crypto functions in sal.");
+constexpr OString sSampleString ("This is a sample sentence, which we use to check some crypto functions in sal."_ostr);
constexpr OStringLiteral sSampleString_only_one_diff ("This is a sample sentence. which we use to check some crypto functions in sal.");
const rtlDigestAlgorithm constDigestAlgorithms[] =
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx
index 6134bc20195a..24e77cd24047 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx
@@ -80,41 +80,41 @@ void createMessage(
void test::oustringbuffer::Utf32::appendUtf32() {
int const str1Len = 3;
sal_Unicode const str1[str1Len] = { 'a', 'b', 'c' };
- static constexpr OUStringLiteral str2 = u"abcd";
- static constexpr OUStringLiteral str3 = u"abcd\U00010000";
+ static constexpr OUString str2 = u"abcd"_ustr;
+ static constexpr OUString str3 = u"abcd\U00010000"_ustr;
OStringBuffer message;
OUStringBuffer buf1(std::u16string_view(str1, str1Len));
buf1.appendUtf32('d');
OUString res1(buf1.makeStringAndClear());
createMessage(message, res1, str2);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- message.getStr(), OUString(str2), res1);
+ message.getStr(), str2, res1);
OUStringBuffer buf2(str2);
buf2.appendUtf32(0x10000);
OUString res2(buf2.makeStringAndClear());
createMessage(message, res2, str3);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- message.getStr(), OUString(str3), res2);
+ message.getStr(), str3, res2);
}
void test::oustringbuffer::Utf32::insertUtf32() {
int const str1Len = 3;
sal_Unicode const str1[str1Len] = { 'a', 'b', 'c' };
- static constexpr OUStringLiteral str2 = u"abdc";
- static constexpr OUStringLiteral str3 = u"ab\U0010FFFFdc";
+ static constexpr OUString str2 = u"abdc"_ustr;
+ static constexpr OUString str3 = u"ab\U0010FFFFdc"_ustr;
OStringBuffer message;
OUStringBuffer buf1(std::u16string_view(str1, str1Len));
buf1.insertUtf32(2, 'd');
OUString res1(buf1.makeStringAndClear());
createMessage(message, res1, str2);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- message.getStr(), OUString(str2), res1);
+ message.getStr(), str2, res1);
OUStringBuffer buf2(str2);
buf2.insertUtf32(2, 0x10FFFF);
OUString res2(buf2.makeStringAndClear());
createMessage(message, res2, str3);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- message.getStr(), OUString(str3), res2);
+ message.getStr(), str3, res2);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/rtl/process/rtl_Process.cxx b/sal/qa/rtl/process/rtl_Process.cxx
index 4895035bf185..391f000c7cad 100644
--- a/sal/qa/rtl/process/rtl_Process.cxx
+++ b/sal/qa/rtl/process/rtl_Process.cxx
@@ -69,7 +69,7 @@ public:
#if defined(_WIN32)
static constexpr OUStringLiteral EXECUTABLE_NAME(u"child_process.exe");
#else
- static constexpr OUStringLiteral EXECUTABLE_NAME(u"child_process");
+ static constexpr OUString EXECUTABLE_NAME(u"child_process"_ustr);
#endif
OUString suCWD = getModulePath();
// OUString suCWD2 = getExecutableDirectory();
@@ -198,7 +198,7 @@ public:
#if defined(_WIN32)
static constexpr OUStringLiteral EXEC_NAME(u"child_process_id.exe");
#else
- static constexpr OUStringLiteral EXEC_NAME(u"child_process_id");
+ static constexpr OUString EXEC_NAME(u"child_process_id"_ustr);
#endif
sal_uInt8 pTargetUUID1[16];
rtl_getGlobalProcessId( pTargetUUID1 );
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index b2d4591065dd..6780b37f55fe 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -3027,7 +3027,7 @@ void Test::testInvalidUtf8() {
auto const converter = rtl_createTextToUnicodeConverter(
RTL_TEXTENCODING_JAVA_UTF8);
CPPUNIT_ASSERT(converter != nullptr);
- constexpr OStringLiteral input(u8"\U00010000");
+ constexpr OString input(u8"\U00010000"_ostr);
sal_Unicode buf[TEST_STRING_SIZE];
sal_uInt32 info;
sal_Size converted;