sw/source/core/unocore/unoidx.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 075ae953e3e673dedcb74d693e516a07b0bebca2 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Apr 15 14:22:27 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Apr 19 08:31:03 2021 +0200 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: https://gerrit.libreoffice.org/c/core/+/114146 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> 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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits