summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-07-09 13:04:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-07-09 15:07:05 +0200
commitf020784e14a55c82418e4f231855040177ac9f82 (patch)
treea2d5c1d2b5778e564b9ee529de0453c73907ce70 /svl
parentac7bba3cc1e13824732f5ab69af602848e4ba227 (diff)
Make loplugin:stringadd slightly more aggressive
...by assuming that all const member functions are side-effect free. (This presumably means that some of the special cases in StringAdd::isSideEffectFree are obsoleted by this more general case, but any such removal is postponed to later clean-up.) (Came across this when idly wondering why 8b7f948d9d79393bc6c1b11d239706666fd5d7de "sc, VmlFormControlExporter: avoid OStringBuffer style" had not been found by the plugin before.) Change-Id: I6bca10df53885b14a590543aabd61f23b3748572 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118675 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/qa/unit/lockfiles/test_lockfiles.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/svl/qa/unit/lockfiles/test_lockfiles.cxx b/svl/qa/unit/lockfiles/test_lockfiles.cxx
index 78e17f2ca5d1..b2bba0f9ce3c 100644
--- a/svl/qa/unit/lockfiles/test_lockfiles.cxx
+++ b/svl/qa/unit/lockfiles/test_lockfiles.cxx
@@ -129,9 +129,7 @@ void LockfileTest::testLOLockFileContent()
// User name
sal_Int32 nFirstChar = 0;
sal_Int32 nNextComma = sLockFileContent.indexOf(',', nFirstChar);
- OUString sUserName;
- sUserName += aUserOpt.GetFirstName() + " ";
- sUserName += aUserOpt.GetLastName();
+ OUString sUserName = aUserOpt.GetFirstName() + " " + aUserOpt.GetLastName();
CPPUNIT_ASSERT_EQUAL(sUserName, sLockFileContent.copy(nFirstChar, nNextComma - nFirstChar));
// System user name
@@ -403,9 +401,7 @@ void LockfileTest::testWordLockFileContent()
aLockFile.RemoveFileDirectly();
// First character is the size of the user name
- OUString sUserName;
- sUserName += aUserOpt.GetFirstName() + " ";
- sUserName += aUserOpt.GetLastName();
+ OUString sUserName = aUserOpt.GetFirstName() + " " + aUserOpt.GetLastName();
int nIndex = 0;
CPPUNIT_ASSERT_EQUAL(sUserName.getLength(), static_cast<sal_Int32>(sLockFileContent[nIndex]));
@@ -457,9 +453,7 @@ void LockfileTest::testExcelLockFileContent()
aLockFile.RemoveFileDirectly();
// First character is the size of the user name
- OUString sUserName;
- sUserName += aUserOpt.GetFirstName() + " ";
- sUserName += aUserOpt.GetLastName();
+ OUString sUserName = aUserOpt.GetFirstName() + " " + aUserOpt.GetLastName();
int nIndex = 0;
CPPUNIT_ASSERT_EQUAL(sUserName.getLength(), static_cast<sal_Int32>(sLockFileContent[nIndex]));
@@ -516,9 +510,7 @@ void LockfileTest::testPowerPointLockFileContent()
aLockFile.RemoveFileDirectly();
// First character is the size of the user name
- OUString sUserName;
- sUserName += aUserOpt.GetFirstName() + " ";
- sUserName += aUserOpt.GetLastName();
+ OUString sUserName = aUserOpt.GetFirstName() + " " + aUserOpt.GetLastName();
int nIndex = 0;
CPPUNIT_ASSERT_EQUAL(sUserName.getLength(), static_cast<sal_Int32>(sLockFileContent[nIndex]));