sw/source/filter/md/wrtmd.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit f630cd696655d640793e655154a0672e64ed7455 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Oct 4 20:38:52 2025 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Mon Oct 6 13:10:06 2025 +0200 cid#1666494 silence Overflowed constant (cherry picked from commit 6716ac27d15749eb22d6884299536b895caf0284) Change-Id: I353c5fc0c887c7dcc37b82a7624a8c743f5f3792 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191942 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/source/filter/md/wrtmd.cxx b/sw/source/filter/md/wrtmd.cxx index 235116150fe5..8622a40c74cb 100644 --- a/sw/source/filter/md/wrtmd.cxx +++ b/sw/source/filter/md/wrtmd.cxx @@ -784,11 +784,13 @@ void OutMarkdown_SwTextNode(SwMDWriter& rWrt, const SwTextNode& rNode, bool bFir positions.redlineEnds.sort(); // Collect flys anchored to this text node. - for (size_t nFly = 0; nFly < rWrt.GetFlys().size(); ++nFly) + size_t nFly = 0; + while (nFly < rWrt.GetFlys().size()) { const SwMDFly& rFly = rWrt.GetFlys()[nFly]; if (rFly.m_nAnchorNodeOffset < rNode.GetIndex()) { + ++nFly; continue; } if (rFly.m_nAnchorNodeOffset > rNode.GetIndex()) @@ -797,7 +799,6 @@ void OutMarkdown_SwTextNode(SwMDWriter& rWrt, const SwTextNode& rNode, bool bFir } SwMDFly aFly = rWrt.GetFlys().erase_extract(nFly); - --nFly; positions.flys.add(aFly.m_nAnchorContentOffset, aFly.m_pFrameFormat); }
