diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 14:27:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-15 14:33:57 +0200 |
commit | f13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch) | |
tree | f9aaab122974d36c134fb1723ec3c1c8df51eeef /filter | |
parent | 9270f74466d0eb841babaa24997f608631c70341 (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 'filter')
-rw-r--r-- | filter/qa/cppunit/priority-test.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/filter/qa/cppunit/priority-test.cxx b/filter/qa/cppunit/priority-test.cxx index 88b232684ecf..223d0c58c937 100644 --- a/filter/qa/cppunit/priority-test.cxx +++ b/filter/qa/cppunit/priority-test.cxx @@ -63,24 +63,20 @@ void PriorityFilterTest::testPriority() OUString aTypeName = xDetection->queryTypeByURL(aURL); OUString aFormatCorrect = OUString::createFromAscii(aToCheck[i].pFormat); - OUStringBuffer aMsg("Mis-matching formats "); - aMsg.append("'"); - aMsg.append(aTypeName); - aMsg.append("' should be '"); - aMsg.append(aFormatCorrect); - aMsg.append("'"); - CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(aMsg.makeStringAndClear(), + OUString aMsg = "Mis-matching formats " + "'" + + aTypeName + + "' should be '" + + aFormatCorrect + + "'"; + CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(aMsg, RTL_TEXTENCODING_UTF8).getStr(), aFormatCorrect, aTypeName); } catch (const uno::Exception &e) { - OUStringBuffer aMsg("Exception querying for type: "); - aMsg.append("'"); - aMsg.append(e.Message); - aMsg.append("'"); - CPPUNIT_FAIL(OUStringToOString(aMsg.makeStringAndClear(), - RTL_TEXTENCODING_UTF8).getStr()); + OUString aMsg = "Exception querying for type: '" + e.Message + "'"; + CPPUNIT_FAIL(OUStringToOString(aMsg, RTL_TEXTENCODING_UTF8).getStr()); } } } |