summaryrefslogtreecommitdiff
path: root/sal/qa/rtl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-14 14:27:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-15 14:33:57 +0200
commitf13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch)
treef9aaab122974d36c134fb1723ec3c1c8df51eeef /sal/qa/rtl
parent9270f74466d0eb841babaa24997f608631c70341 (diff)
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/qa/rtl')
-rw-r--r--sal/qa/rtl/uri/rtl_testuri.cxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx
index 3310ec25bba6..aea0d50c6c54 100644
--- a/sal/qa/rtl/uri/rtl_testuri.cxx
+++ b/sal/qa/rtl/uri/rtl_testuri.cxx
@@ -44,7 +44,6 @@ void Test::test_Uri() {
rtl_UriCharClass const eFirstCharClass = rtl_UriCharClassNone;
rtl_UriCharClass const eLastCharClass = rtl_UriCharClassUnoParamValue;
- OUStringBuffer aBuffer;
OUString aText1;
OUString aText2;
@@ -182,12 +181,11 @@ void Test::test_Uri() {
// Check surrogate handling:
- aBuffer.append(u'\xD800'); // %ED%A0%80
- aBuffer.append(u'\xD800'); // %F0%90%8F%BF
- aBuffer.append(u'\xDFFF');
- aBuffer.append(u'\xDFFF'); // %ED%BF%BF
- aBuffer.append('A'); // A
- aText1 = aBuffer.makeStringAndClear();
+ aText1 = OUStringLiteral1(u'\xD800') + // %ED%A0%80
+ OUStringLiteral1(u'\xD800') + // %F0%90%8F%BF
+ OUStringLiteral1(u'\xDFFF') +
+ OUStringLiteral1(u'\xDFFF') + // %ED%BF%BF
+ "A"; // A
aText2 = "%ED%A0%80" "%F0%90%8F%BF" "%ED%BF%BF" "A";
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"failure 11",
@@ -209,12 +207,11 @@ void Test::test_Uri() {
RTL_TEXTENCODING_UTF8));
aText1 = "%ed%a0%80" "%f0%90%8f%bf" "%ed%bf%bf" "A";
- aBuffer.append("%ED%A0%80");
- aBuffer.append(u'\xD800');
- aBuffer.append(u'\xDFFF');
- aBuffer.append("%ED%BF%BF");
- aBuffer.append('A');
- aText2 = aBuffer.makeStringAndClear();
+ aText2 = "%ED%A0%80" +
+ OUStringLiteral1(u'\xD800') +
+ OUStringLiteral1(u'\xDFFF') +
+ "%ED%BF%BF"
+ "A";
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"failure 14",
aText2,
@@ -250,9 +247,8 @@ void Test::test_Uri() {
// Check IURI handling:
aText1 = "%30%C3%BF";
- aBuffer.append("%30");
- aBuffer.append(u'\x00FF');
- aText2 = aBuffer.makeStringAndClear();
+ aText2 = "%30" +
+ OUStringLiteral1(u'\x00FF');
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"failure 18",
aText2,