dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx |    2 +-
 sw/source/core/doc/DocumentRedlineManager.cxx         |    2 +-
 sw/source/core/doc/ftnidx.cxx                         |   10 +++++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit c46c109204675d9a04ed16b8c53fdba71519ef4a
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Sep 22 20:36:24 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Sep 24 10:12:44 2024 +0200

    cid#1607535 silence Overflowed constant
    
    and
    
    cid#1608504 Overflowed constant
    cid#1607518 Overflowed constant
    
    Change-Id: Ife45a2f414ea703f627b7083d746bc11f6d4f359
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173832
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx 
b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index befb38b6812d..b674baa0b916 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1618,7 +1618,7 @@ OTableFieldDescRef 
OSelectionBrowseBox::FindFirstFreeCol(sal_uInt16& _rColumnPos
 
     for (auto const& field : getFields())
     {
-        ++_rColumnPosition;
+        _rColumnPosition = static_cast<sal_uInt16>(_rColumnPosition + 1);
         OTableFieldDescRef pEntry = field;
         if ( pEntry.is() && pEntry->IsEmpty() )
             return pEntry;
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 8be40de4c498..411727e1880f 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1404,7 +1404,7 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
     bool bCompress = false;
     SwRedlineTable::size_type n = 0;
     // look up the first Redline for the starting position
-    if( !GetRedline( *pStt, &n ) && n )
+    if( !GetRedline( *pStt, &n ) && n > 0 )
         --n;
     const SwRedlineTable::size_type nStartPos = n;
     bool bDec = false;
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 81f6378c5a49..c96bda71f04f 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -135,8 +135,12 @@ void SwFootnoteIdxs::UpdateFootnote( const SwNode& rStt )
         {
             // Step forward until the Index is not the same anymore
             const SwNode* pCmpNd = &rStt;
-            while( nPos && pCmpNd == &((*this)[ --nPos ]->GetTextNode()) )
-                ;
+            while (nPos > 0)
+            {
+                --nPos;
+                if (pCmpNd != &((*this)[nPos]->GetTextNode()))
+                    break;
+            }
             ++nPos;
         }
 
@@ -146,7 +150,7 @@ void SwFootnoteIdxs::UpdateFootnote( const SwNode& rStt )
         if( rOutlNds.empty() )
         {
             nFootnoteNo = nPos+1;
-            if (nPos)
+            if (nPos > 0)
             {
                 nFootnoteNoHidden = (*this)[nPos - 
1]->GetFootnote().GetNumberRLHidden() + 1;
             }

Reply via email to