add assert in SwNodes::ForEach

to catch any dodgy code

Change-Id: Iffd0612b28871c864f103634a40d13b82160d1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177955
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-12-06 11:24:41 +02:00
parent e7268b7d9e
commit 31d0c99c31

View file

@ -2275,6 +2275,7 @@ SwNode* SwNodes::FindPrvNxtFrameNode( const SwNode& rFrameNd,
void SwNodes::ForEach( SwNodeOffset nStart, SwNodeOffset nEnd,
FnForEach_SwNodes fn, void* pArgs )
{
assert( nEnd <= SwNodeOffset(m_nSize) );
if( nEnd > SwNodeOffset(m_nSize) )
nEnd = SwNodeOffset(m_nSize);