cid#1608322 silence Overflowed constant

Change-Id: I23229d2bb29c926f9840f11b09ebc591f1b0047f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173544
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara 2024-09-17 10:24:33 +01:00
parent b289d5f5cb
commit b8ef51bc01

View File

@ -105,7 +105,8 @@ void RestFlyInRange( SaveFlyArr & rArr, const SwPosition& rStartPos,
void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr )
{
sw::SpzFrameFormats& rSpzs = *rRg.aStart.GetNode().GetDoc().GetSpzFrameFormats();
for(sw::FrameFormats<sw::SpzFrameFormat*>::size_type n = 0; n < rSpzs.size(); ++n )
sw::FrameFormats<sw::SpzFrameFormat*>::size_type n = 0;
while (n < rSpzs.size())
{
auto pSpz = rSpzs[n];
SwFormatAnchor const*const pAnchor = &pSpz->GetAnchor();
@ -126,8 +127,10 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr )
SwFormatAnchor aAnchor( pSpz->GetAnchor() );
aAnchor.SetAnchor(nullptr);
pSpz->SetFormatAttr(aAnchor);
rSpzs.erase( rSpzs.begin() + n-- );
rSpzs.erase( rSpzs.begin() + n );
continue;
}
++n;
}
sw::CheckAnchoredFlyConsistency(rRg.aStart.GetNode().GetDoc());
}