summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-10-27 23:18:23 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-10-28 08:03:52 +0100
commit40fa3a61ac7dbe2ba73b5ee71bb85cc3bb4a27af (patch)
tree26f9d288b5434f5e23980053dab9d5a57749b60e /comphelper
parentc4967928475f2be20ac2d79e3fa84ac435a7e560 (diff)
Extend loplugin:elidestringvar to OString
(In VisitVarDecl, filtering out AbstractConditionalOperator avoids an unhelpful > ~/lo/core/vcl/source/pdf/XmpMetadata.cxx:63:32: error: replace single use of literal 'rtl::OString' variable with a literal [loplugin:elidestringvar] > aXmlWriter.content(sPdfConformance); > ^~~~~~~~~~~~~~~ > ~/lo/core/vcl/source/pdf/XmpMetadata.cxx:52:21: note: literal 'rtl::OString' variable defined here [loplugin:elidestringvar] > OString sPdfConformance = (mnPDF_A == 1) ? "A" : "B"; > ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) Change-Id: I7d0410f04827d79b4b526752917c37d33cad2671 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104911 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/qa/string/test_string.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx
index aa427bea8a65..faedac30260f 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -75,14 +75,11 @@ void TestString::testDecimalStringToNumber()
void TestString::testIsdigitAsciiString()
{
- OString s1("1234");
- CPPUNIT_ASSERT_EQUAL(true, comphelper::string::isdigitAsciiString(s1));
+ CPPUNIT_ASSERT_EQUAL(true, comphelper::string::isdigitAsciiString(OString("1234")));
- OString s2("1A34");
- CPPUNIT_ASSERT_EQUAL(false, comphelper::string::isdigitAsciiString(s2));
+ CPPUNIT_ASSERT_EQUAL(false, comphelper::string::isdigitAsciiString(OString("1A34")));
- OString s3;
- CPPUNIT_ASSERT_EQUAL(true, comphelper::string::isdigitAsciiString(s3));
+ CPPUNIT_ASSERT_EQUAL(true, comphelper::string::isdigitAsciiString(OString()));
}
using namespace ::com::sun::star;
@@ -369,8 +366,7 @@ void TestString::testTokenCount()
void TestString::testReverseString()
{
- OString aIn("ABC");
- OString aOut = ::comphelper::string::reverseString(aIn);
+ OString aOut = ::comphelper::string::reverseString(OString("ABC"));
CPPUNIT_ASSERT_EQUAL(OString("CBA"), aOut);
}