sw/source/core/txtnode/thints.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 6e16e1812292236ed61b637371f70459cf993b7f
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Apr 7 20:14:46 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Apr 8 18:11:06 2025 +0200

    tdf#64991 exit some loops early
    
    Change-Id: Ic3b5a8a2df5a484150edb95fcacf8960b53a6ead
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183855
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index c74a17563efd..1e482684edb7 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -663,6 +663,10 @@ void SwpHints::BuildPortions( SwTextNode& rNode, 
SwTextAttr& rNewHint,
                 continue;
 
             sal_Int32 nOtherStart = pOther->GetStart();
+            if (nThisEnd < nOtherStart)
+                break;
+            if (nThisStart < nOtherStart)
+                continue;
             const sal_Int32 nOtherEnd = *pOther->GetEnd();
 
             // Check if start of new attribute overlaps with pOther:
@@ -734,6 +738,10 @@ void SwpHints::BuildPortions( SwTextNode& rNode, 
SwTextAttr& rNewHint,
                 continue;
 
             const sal_Int32 nOtherStart = pOther->GetStart();
+            if (nThisEnd < nOtherStart)
+                break;
+            if (nThisStart < nOtherStart)
+                continue;
             const sal_Int32 nOtherEnd = *pOther->End();
 
             if (nThisStart <= nOtherStart && nOtherStart <= nThisEnd)

Reply via email to