summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-02-02 16:02:19 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-02-04 09:12:15 +0100
commit04b4c269fc2e4001eb37c4b2c34a023a44ca6ebe (patch)
tree6d2c868090f271e0610ee4ad09e48258dc4da04a /vcl
parent6694e3ea9c2f05a20245d94c5c1eda955cb3aacc (diff)
tdf#137920 sw: avoid layout loop when inserting at-char anchored large image
Regression from commit d250ca91c79f457102daf4da81446b7f130fb0ee (sw: insert image: set anchor to at-char by default, 2019-11-18), the problem was that the document has 2 pages, the first page would host the anchor of an inserted image and looped while creating/deleting a next page frame when updating the layout on inserting of an image. This problem was less visible before, as the at-para anchor is a different codepath, which was the previous default. The primary problem is that the loop in SwLayAction::Action() assumes that we make progress, so in case m_bAgain is set, then doing the layout again won't re-set m_bAgain, but it happened here. That happens because each iteration calls SwFrame::InsertPage(), followed by a SwPageFrame::DestroyImpl(). Examining the backtrace of the SwPageFrame ctor leads to SwTextFrame::FormatAdjust() which tries to split the text frame only in case it has either a number portion or a text portion, but the check there was incomplete: a "none" number format results in no number portion, leading to this loop. Fix the problem by checking for HasVisibleNumberingOrBullet() before assuming that we can split an empty text frame into two pieces where at least one of them is not empty. (cherry picked from commit 3e9975cf507e24e9c501575c501833164d217acc) Change-Id: I454e1ec275ad6c00202e65b97adb79647d11a0b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129395 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129410
Diffstat (limited to 'vcl')
0 files changed, 0 insertions, 0 deletions