From 74299624ec810f9683326608ad398211cf51787b Mon Sep 17 00:00:00 2001 From: RMZeroFour Date: Sun, 24 Mar 2024 10:09:49 +0530 Subject: tdf#158237 Use contains instead of find-end As part of the efforts in #158237 to replace older parts of the codebase using find() and end() methods, with contains(), this commit does the needed changes for a few files in the sc and sw modulues. Change-Id: Ibf0a432c537879f5bec8e8912d11150733366689 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165223 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- sw/source/core/layout/paintfrm.cxx | 2 +- sw/source/core/unocore/unotextmarkup.cxx | 2 +- sw/source/filter/ww8/docxattributeoutput.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 88175ddc250a..042c4f3be4a7 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4577,7 +4577,7 @@ void SwTextFrame::PaintParagraphStylesHighlighting() const // draw styles highlighter OUString sStyleName = GetTextNodeFirst()->GetTextColl()->GetName(); - if (rParaStylesColorMap.find(sStyleName) != rParaStylesColorMap.end()) + if (rParaStylesColorMap.contains(sStyleName)) { SwRect aFrameAreaRect(getFrameArea()); diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx index 4bbc8601608d..6c49044f4911 100644 --- a/sw/source/core/unocore/unotextmarkup.cxx +++ b/sw/source/core/unocore/unotextmarkup.cxx @@ -478,7 +478,7 @@ uno::Any SAL_CALL SwXStringKeyMap::getValue(const OUString & aKey) sal_Bool SAL_CALL SwXStringKeyMap::hasValue(const OUString & aKey) { - return maMap.find( aKey ) != maMap.end(); + return maMap.contains(aKey); } void SAL_CALL SwXStringKeyMap::insertValue(const OUString & aKey, const uno::Any & aValue) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 47ffb332bf21..31711eb4e887 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -577,7 +577,7 @@ sal_Int32 DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t p { const SfxGrabBagItem& rParaGrabBag = static_cast(*pItem); const std::map& rMap = rParaGrabBag.GetGrabBag(); - bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && rMap.find("ParaSdtEndBefore") != rMap.end(); + bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && rMap.contains("ParaSdtEndBefore"); } } } -- cgit