path: root/sw
diff options
authorStephan Bergmann <>2021-04-15 14:22:27 +0200
committerStephan Bergmann <>2021-04-19 08:31:03 +0200
commit075ae953e3e673dedcb74d693e516a07b0bebca2 (patch)
treedde770d6842a198662f235b1b3de16188da19296 /sw
parentb3066bc55830e3fff93dbc68f666c5b961c051c7 (diff)
Fix two string matches to not include the trailing NULs
...which had apparently been broken ever since they got introduced with 399fb822ef81bd2440da8ab48cc2028a6b44d5b7 "swunolocking1: #i105557#: fix locking for SwXDocumentIndex". (The first mis-use of sizeof had already been silently fixed with 46ce0d28b4c765076c7871358375c4e85e44534b "loplugin:stringliteralvar look for assignments". And we can now use the OUString::match overloads that take const char arrays, instead of using OUString::matchAsciiL, and simplify the first one even further to use OUString::startsWith.) Change-Id: I1e7975f29e225bae74ed0c2d447e541fa47bd954 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
Diffstat (limited to 'sw')
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 7783e65756e1..c4f5ddf17980 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -152,8 +152,8 @@ lcl_ConvertTOUNameToUserName(OUString& rTmp)
USER_AND_SUFFIXLEN == rTmp.getLength())
//make sure that in non-English versions the " (user)" suffix is removed
- if (rTmp.match(cUserDefined) &&
- rTmp.matchAsciiL(cUserSuffix, sizeof(cUserSuffix), USER_LEN))
+ if (rTmp.startsWith(cUserDefined) &&
+ rTmp.match(cUserSuffix, USER_LEN))
rTmp = cUserDefined;