diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-22 20:36:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-24 10:12:44 +0200 |
commit | c46c109204675d9a04ed16b8c53fdba71519ef4a (patch) | |
tree | 434631d5b5a2222a0e3a1883c1c8e5570b567e1c /sw/source | |
parent | f528d18f99f5d45ccb4ac0beb12045e51fbea477 (diff) |
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.mcnamara@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/ftnidx.cxx | 10 |
2 files changed, 8 insertions, 4 deletions
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; } |