diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-16 21:38:53 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-11-17 15:41:03 +0100 |
commit | 033043c404c841860f241151d69c7b46640801b4 (patch) | |
tree | 403358e8106f4ef91973a82d2ecd53d0781e4347 | |
parent | 5d2de069349528a137c8136233635dc3b9cc5f83 (diff) |
cid#1607919 Overflowed constant
Change-Id: I842357000f3282521aa927921a5598fddaef5dee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176686
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 81f0585655ef..b6f2ba079fbf 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2603,7 +2603,7 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) bool bChg = false; SwRedlineTable::size_type n = 0; //FIXME overlapping problem GetRedline( *pStt, &n ); - for ( ; n < maRedlineTable.size(); ++n) + while (n < maRedlineTable.size()) { SwRangeRedline * pRedline = maRedlineTable[ n ]; auto [pRedlineStart, pRedlineEnd] = pRedline->StartEnd(); @@ -2635,7 +2635,8 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) case 3: pRedline->InvalidateRange(SwRangeRedline::Invalidation::Remove); - maRedlineTable.DeleteAndDestroy( n-- ); + maRedlineTable.DeleteAndDestroy( n ); + // loop again with the same n to iterate to the next entry pRedline = nullptr; break; } @@ -2655,6 +2656,8 @@ bool DocumentRedlineManager::SplitRedline( const SwPaM& rRange ) } else if (*pEnd < *pRedlineStart) break; + if (pRedline) + ++n; } return bChg; |