sw/source/uibase/sidebar/CommentsPanel.cxx         |    6 +++---
 sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit a308151714a2bc811f6f147055175de9767d313a
Author:     Jack Honour <jaxk...@gmail.com>
AuthorDate: Thu Oct 24 14:15:56 2024 +0100
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Fri Oct 25 15:22:52 2024 +0200

    tdf#158237 Use C++20 contains() instead of find() and end()
    
    Change-Id: I58be12e3b32a82f137486a314d28b1aaca2202fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175557
    Reviewed-by: Hossein   <hoss...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/sidebar/CommentsPanel.cxx 
b/sw/source/uibase/sidebar/CommentsPanel.cxx
index 33f656409caf..edad2a8d5c17 100644
--- a/sw/source/uibase/sidebar/CommentsPanel.cxx
+++ b/sw/source/uibase/sidebar/CommentsPanel.cxx
@@ -416,7 +416,7 @@ void CommentsPanel::populateComments()
             continue;
         sal_uInt32 nRootId = getPostItId(pRootNote);
 
-        if (mpThreadsMap.find(nRootId) != mpThreadsMap.end())
+        if (mpThreadsMap.contains(nRootId))
         {
             if (mxSortbyPosition->get_active())
                 continue;
@@ -491,7 +491,7 @@ void CommentsPanel::addComment(const SwFormatField* pField)
     sw::annotation::SwAnnotationWin* pNote
         = mpPostItMgr->GetAnnotationWin(static_cast<const 
SwPostItField*>(pField->GetField()));
     // If comment is added to an existing thread
-    if (mpThreadsMap.find(nRootId) != mpThreadsMap.end())
+    if (mpThreadsMap.contains(nRootId))
     {
         auto& pThread = mpThreadsMap[nRootId];
         auto pComment = 
std::make_unique<Comment>(pThread->getCommentBoxWidget(), *this);
@@ -561,7 +561,7 @@ void CommentsPanel::deleteComment(sal_uInt32 nId)
     if (--pThread->mnComments == 0)
     {
         mxThreadsContainer->move(pThread->get_widget(), nullptr);
-        if (mpThreadsMap.find(nRootId) != mpThreadsMap.end())
+        if (mpThreadsMap.contains(nRootId))
             mpThreadsMap.erase(nRootId);
         mnThreads--;
     }
diff --git a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx 
b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx
index 086230b0d941..f874466affdc 100644
--- a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx
+++ b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx
@@ -453,7 +453,7 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
         uno::Reference<document::XDocumentPropertiesSupplier> 
xDocumentPropertiesSupplier(mxModel, uno::UNO_QUERY);
         uno::Reference<document::XDocumentProperties> xDocumentProperties = 
xDocumentPropertiesSupplier->getDocumentProperties();
         comphelper::SequenceAsHashMap 
aMap(xDocumentProperties->getDocumentStatistics());
-        if (aMap.find(u"ParagraphCount"_ustr) != aMap.end())
+        if (aMap.contains(u"ParagraphCount"_ustr))
         {
             sal_Int32 nValue;
             if (aMap[u"ParagraphCount"_ustr] >>= nValue)

Reply via email to