diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-02-02 16:02:19 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-02-03 11:29:17 +0100 |
commit | 1a9147b86bb8f06efd1275b2025cd7f464e0331d (patch) | |
tree | 6fe73de08a11f6650e3313783f11001856e73125 /oox | |
parent | 4c5013818613d25b01051eafda9aef50b43d7163 (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>
Diffstat (limited to 'oox')
0 files changed, 0 insertions, 0 deletions