sw/source/uibase/utlui/content.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit a08197e7c376c72685260ae923483ae99f929d35 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Thu Jan 18 21:52:37 2024 -0900 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Fri Jan 19 16:43:57 2024 +0100 tdf#159147 followup Avoid unnecessary looping by immediate return from the function after bringing content to attention. Change-Id: I670dc5d0991d96e7ce2872d329e969f9c341d163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162291 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c5f2b3e3afa9..f753547173b4 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -6100,13 +6100,13 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry) for (auto n = pFormats->size(); 1 < n;) { SwIterator<SwTextINetFormat, SwCharFormat> aIter(*(*pFormats)[--n]); - for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) + for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next()) { if (pTextINetFormat == pFnd) { BringURLFieldsToAttention(SwGetINetAttrs {SwGetINetAttr(pCnt->GetName(), *pTextINetFormat)}); - break; + return; } } }