sw: fix assert in SwObjectFormatterTextFrame
commit611f1e5e6637610295d449c286d3d6981dd735aa
authorCaolán McNamara <caolanm@redhat.com>
Fri, 10 Sep 2021 18:51:41 +0000 (10 19:51 +0100)
committerCaolán McNamara <caolanm@redhat.com>
Tue, 17 May 2022 19:00:21 +0000 (17 21:00 +0200)
treebb906795492d15dbed8310175c8552adbd6866aa
parent16b70040181ecf8bcbd4f0e505de0f77e518b160
sw: fix assert in SwObjectFormatterTextFrame

sw/source/core/layout/objectformattertxtfrm.cxx:237: virtual bool SwObjectFormatterTextFrame::DoFormatObj(SwAnchoredObject&, bool): Assertion `GetPageFrame().GetPhyPageNum() == GetPgNumOfCollected(nIdx)' failed.

The problem is that there are multiple (9) flys on text frame 324.

In the loop in CalcContent(), frame 324 starts out on page 13, then
with the first/second fly moves to page 12, then with the 3rd fly moves
forward to page 13 - but the pPageFrame that is passed to
SwObjectFormatter::FormatObj() was fetched outside of the loop.

(regression from commit c799de145f7e289f31e3669646e5bd12814e6c5e
 and commit 533a998e540b0f04068c876dde0e74adc3f79c93)

Change-Id: Iae573900b4b6558634bfed161e5c95bd5ba27151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121924
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 7d20dc2ca69711c61fb1593ad85ccdef282c978d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134447
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
sw/qa/extras/layout/data/tdf123163-1.docx [new file with mode: 0644]
sw/qa/extras/layout/layout.cxx
sw/source/core/layout/fly.cxx