sw/source/uibase/sidebar/CommentsPanel.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 6522da9cde7e21a7d6f3d2c03b12062d80d83e1b Author: Nam Bui <ndbu...@gmail.com> AuthorDate: Thu Mar 27 18:43:25 2025 -0400 Commit: David Gilbert <freedesk...@treblig.org> CommitDate: Sat Mar 29 02:01:48 2025 +0100 tdf#158237 Use C++20 contains() instead of find() and end() Changed find() == end() to !contains() in sw/source/uibase/sidebar/CommentsPanel.cxx Change-Id: I02d31c148d1b2feace0e97ae6318d523793b07a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183422 Tested-by: Jenkins Reviewed-by: David Gilbert <freedesk...@treblig.org> diff --git a/sw/source/uibase/sidebar/CommentsPanel.cxx b/sw/source/uibase/sidebar/CommentsPanel.cxx index b9d84508a569..e47d5aa59353 100644 --- a/sw/source/uibase/sidebar/CommentsPanel.cxx +++ b/sw/source/uibase/sidebar/CommentsPanel.cxx @@ -540,7 +540,7 @@ void CommentsPanel::deleteComment(sal_uInt32 nId) sal_uInt32 nRootId = getPostItId(pRootNote); - if (mpThreadsMap.find(nRootId) == mpThreadsMap.end()) + if (!mpThreadsMap.contains(nRootId)) { SAL_WARN("sw", "Comments Panel is unable to delete comment: Referenced thread does not exist!"); @@ -571,7 +571,7 @@ void CommentsPanel::deleteComment(sal_uInt32 nId) void CommentsPanel::setResolvedStatus(const sw::annotation::SwAnnotationWin* pAnnotationWin) { sal_uInt32 nId = getPostItId(pAnnotationWin); - if (mpCommentsMap.find(nId) == mpCommentsMap.end()) + if (!mpCommentsMap.contains(nId)) return; auto& pComment = mpCommentsMap[nId]; if (!pComment)