sw/source/core/doc/DocumentContentOperationsManager.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 426019a4ed329a5b7af3ce998068ea3479e8bff7
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Oct 10 19:59:42 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Oct 11 10:45:29 2024 +0200

    cid#1606973 Overflowed constant
    
    Change-Id: Ibb81acb35baaf370beba7042d60a0f99f1d8852b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174773
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index e8c0055f9e49..bcd58192d800 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1035,9 +1035,15 @@ namespace
                 }
             }
 
-            while( nPos-- && ( pFootnoteNd = &( pSrch = rFootnoteArr[ nPos ] 
)->
-                    GetTextNode())->GetIndex() >= rSttNd.GetIndex() )
+            for (;;)
             {
+                if (!nPos)
+                    break;
+                nPos--;
+                pSrch = rFootnoteArr[ nPos ];
+                pFootnoteNd = &pSrch->GetTextNode();
+                if (pFootnoteNd->GetIndex() < rSttNd.GetIndex())
+                    break;
                 const sal_Int32 nFootnoteSttIdx = pSrch->GetStart();
                 if( !oEndCnt || !oSttCnt ||
                     !  (( &rSttNd == pFootnoteNd &&

Reply via email to