sw/source/core/text/porfly.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit d7e3a59c0ebce08ae623ae2df6a9135b78525ec1
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Oct 19 19:31:09 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Oct 20 15:37:08 2024 +0200

    cid#1607208 Overflowed constant
    
    Change-Id: I9e4aa51281e1fcaa208a0992281ac9050fe40306
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175244
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 54c0dc4f7ac7..ac0c96590f93 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -164,7 +164,8 @@ void SwTextFrame::MoveFlyInCnt(SwTextFrame *pNew,
     if ( nullptr == pObjs )
         return;
 
-    for ( size_t i = 0; GetDrawObjs() && i < pObjs->size(); ++i )
+    size_t i = 0;
+    while (GetDrawObjs() && i < pObjs->size())
     {
         // Consider changed type of <SwSortedList> entries
         SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
@@ -185,9 +186,10 @@ void SwTextFrame::MoveFlyInCnt(SwTextFrame *pNew,
                     RemoveDrawObj( *pAnchoredObj );
                     pNew->AppendDrawObj( *pAnchoredObj );
                 }
-                --i;
+                continue; // pObjs shrunk
             }
         }
+        ++i;
     }
 }
 
commit e98801c0fe67d4c5b25827041a2051858a66cc1c
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Oct 19 19:28:52 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Oct 20 15:37:01 2024 +0200

    if this could happen, then this loop would never end
    
    so in practice it isn't happening. (Or the --i should be conditional
    on something getting removed)
    
    Change-Id: I0d74a46eced77c5bb1474c60c26e39061de791a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175243
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 6cfcec2962b4..54c0dc4f7ac7 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -180,7 +180,7 @@ void SwTextFrame::MoveFlyInCnt(SwTextFrame *pNew,
                     RemoveFly( pFlyFrame );
                     pNew->AppendFly( pFlyFrame );
                 }
-                else if ( dynamic_cast< const SwAnchoredDrawObject *>( 
pAnchoredObj ) !=  nullptr )
+                else
                 {
                     RemoveDrawObj( *pAnchoredObj );
                     pNew->AppendDrawObj( *pAnchoredObj );

Reply via email to