diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-11 16:39:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-11 16:39:43 +0100 |
commit | 584262fed1368dba382d88dfd25fe35ac7d4b349 (patch) | |
tree | bed7da36f2db982ec0491e926df1e414f8dcf86d /sal | |
parent | e316c4f2a40a4a562028f0a66c40321ffdf87378 (diff) |
loplugin:stringconstant: handle OStringBuffer::append
Change-Id: I283da52c0ee2b63c19e31e9a61ab24997c037a6a
Diffstat (limited to 'sal')
-rw-r--r-- | sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx | 4 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_convert.cxx | 24 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_endswith.cxx | 5 |
3 files changed, 16 insertions, 17 deletions
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx index d47fd5f0efc0..e71614641ce0 100644 --- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx +++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx @@ -49,7 +49,7 @@ namespace { void appendString(rtl::OStringBuffer & buffer, rtl::OUString const & string) { buffer.append('"'); for (int i = 0; i < string.getLength(); ++i) { - buffer.append(RTL_CONSTASCII_STRINGPARAM("\\u")); + buffer.append("\\u"); sal_Unicode c = string[i]; if (c < 0x1000) { buffer.append('0'); @@ -72,7 +72,7 @@ void createMessage( { message.setLength(0); appendString(message, string1); - message.append(RTL_CONSTASCII_STRINGPARAM(" vs. ")); + message.append(" vs. "); appendString(message, string2); } diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx index 639d9b744555..f92ce9378301 100644 --- a/sal/qa/rtl/strings/test_oustring_convert.cxx +++ b/sal/qa/rtl/strings/test_oustring_convert.cxx @@ -63,28 +63,28 @@ void testConvertToString(TestConvertToString const & rTest) rTest.nFlags)); rtl::OStringBuffer aPrefix; - aPrefix.append(RTL_CONSTASCII_STRINGPARAM("{")); + aPrefix.append("{"); for (sal_Int32 i = 0; i < rTest.nLength; ++i) { - aPrefix.append(RTL_CONSTASCII_STRINGPARAM("U+")); + aPrefix.append("U+"); aPrefix.append(static_cast< sal_Int32 >(rTest.aSource[i]), 16); if (i + 1 < rTest.nLength) - aPrefix.append(RTL_CONSTASCII_STRINGPARAM(",")); + aPrefix.append(","); } - aPrefix.append(RTL_CONSTASCII_STRINGPARAM("}, ")); + aPrefix.append("}, "); aPrefix.append(static_cast< sal_Int32 >(rTest.nEncoding)); - aPrefix.append(RTL_CONSTASCII_STRINGPARAM(", 0x")); + aPrefix.append(", 0x"); aPrefix.append(static_cast< sal_Int32 >(rTest.nFlags), 16); - aPrefix.append(RTL_CONSTASCII_STRINGPARAM(" -> ")); + aPrefix.append(" -> "); if (bSuccess) { if (rTest.pStrict == nullptr || !aStrict.equals(rTest.pStrict)) { rtl::OStringBuffer aMessage(aPrefix); - aMessage.append(RTL_CONSTASCII_STRINGPARAM("strict = \"")); + aMessage.append("strict = \""); aMessage.append(aStrict); - aMessage.append(RTL_CONSTASCII_STRINGPARAM("\"")); + aMessage.append("\""); CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), false); } } @@ -93,22 +93,22 @@ void testConvertToString(TestConvertToString const & rTest) if (!aStrict.equals(rtl::OString(RTL_CONSTASCII_STRINGPARAM("12345")))) { rtl::OStringBuffer aMessage(aPrefix); - aMessage.append(RTL_CONSTASCII_STRINGPARAM("modified output")); + aMessage.append("modified output"); CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), false); } if (rTest.pStrict != nullptr) { rtl::OStringBuffer aMessage(aPrefix); - aMessage.append(RTL_CONSTASCII_STRINGPARAM("failed")); + aMessage.append("failed"); CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), false); } } if (!aRelaxed.equals(rTest.pRelaxed)) { rtl::OStringBuffer aMessage(aPrefix); - aMessage.append(RTL_CONSTASCII_STRINGPARAM("relaxed = \"")); + aMessage.append("relaxed = \""); aMessage.append(aRelaxed); - aMessage.append(RTL_CONSTASCII_STRINGPARAM("\"")); + aMessage.append("\""); CPPUNIT_ASSERT_MESSAGE(aMessage.getStr(), false); } } diff --git a/sal/qa/rtl/strings/test_oustring_endswith.cxx b/sal/qa/rtl/strings/test_oustring_endswith.cxx index 37d5c608c127..8912a4027027 100644 --- a/sal/qa/rtl/strings/test_oustring_endswith.cxx +++ b/sal/qa/rtl/strings/test_oustring_endswith.cxx @@ -96,10 +96,9 @@ void test::oustring::EndsWith::endsWith() for (size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) { rtl::OStringBuffer msg; appendString(msg, rtl::OString(data[i].str1, data[i].str1Len)); - msg.append( - RTL_CONSTASCII_STRINGPARAM(".endsWithIgnoreAsciiCaseAsciiL(")); + msg.append(".endsWithIgnoreAsciiCaseAsciiL("); appendString(msg, rtl::OString(data[i].str2, data[i].str2Len)); - msg.append(RTL_CONSTASCII_STRINGPARAM(") == ")); + msg.append(") == "); msg.append(data[i].endsWith); CPPUNIT_ASSERT_EQUAL_MESSAGE( msg.getStr(), |