sw/source/core/edit/eddel.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 2247b00230e479e63ab996d4e1694b1d74aeba81 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Oct 16 20:04:10 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Oct 16 22:06:04 2023 +0200 Simplify a bit Non-negative nCommentPos implies non-empty selection. Change-Id: Id3e5701fbddca3159d81513d8c7d54816e45e4c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158060 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 989cddfd3a28..9eb51da617b1 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -382,12 +382,12 @@ bool SwEditShell::ReplaceKeepComments( const OUString& rNewStr) OUString aSelectedText = pCursor->GetText(); sal_Int32 nCommentPos(aSelectedText.lastIndexOf(CH_TXTATR_INWORD)); // go sure that we have a valid selection and a comment has been found - while((nCommentPos > -1) && (aSelectedText.getLength() > 0) && (pCursor->HasMark())) + while (nCommentPos > -1) { // select the part of the text after the last found comment // selection start: pCursor->GetPoint()->AdjustContent(nCommentPos + 1); - // selection end ist left where it is -> will be adjusted later on + // selection end is left where it is -> will be adjusted later on // delete the part of the word after the last found comment Replace(OUString(), false); // put the selection start back to the beginning of the word