diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-09-21 08:31:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-09-21 09:46:28 +0200 |
commit | cfe9c68a7a19dd77d1fcbde3a7dd75730634becc (patch) | |
tree | a09e38fe1c16daddf3001c062e9fc10f5fbe5762 /starmath/qa | |
parent | 7ac978c4d18c1a91fdc784eb3e5ea381a783efdb (diff) |
tdf#157119 sw floattable: fix moving master of split fly to next page
The problem with the bugdoc is that in case you split the text frame
hosting the start of the anchor text, then the fly will be split in a
broken way on pages 1 -> 4 -> 2, while we want a split on just pages 2
-> 3.
There were several problems here:
1) We created an unnecessary follow fly in SwFrame::GetNextFlyLeaf():
when page 1 wanted to split, we discarded the flys on page 2 and 3,
because the original anchor was in the body text and the flys on page
2/3 was in a fly, so that's rejected. This resulted in a follow fly on
page 4, which is not correct. Fix this by using an existing follow if
possible, this is similar to what SwFrame::GetNextSctLeaf() does.
2) SwFlyAtContentFrame::DelEmpty() broke the invariant that in case the
fly is split to N pieces then the anchor chain's first N frame is
matching that. Fix this by joining the unwanted anchor with its
follow right before unlinking the to-be-deleted fly from the fly chain.
3) SwToContentAnchoredObjectPosition::CalcOverlap() tried to shift down
flys due to overlapping with the to-be-deleted frames, fix this by
ignoring flys which are already in the to-delete list.
4) SwContentFrame::ShouldBwdMoved() tried to move the master fly back
from page 2 to page 1, which makes no sense, since there is not
enough space there to lay out the fly master correctly there.
Normally we only check if the paragraph fits the remaining space on
the previous page, and this is wanted: if there is a normal to-para
anchored image that would not fit, we simply shift up the image. But
this is not wanted to floating tables, since here the anchor's only
purpose is to host the start of the fly chain at a correct position.
Fix this by checking not only for the text frame height vs the
available space, but also the height of our (only) anchored object.
Note that 3) is not a huge problem, it just causes some extra cycles for
the layout (erase the to-delete flys, then position flys once more), do
it because things are complicated enough already.
Change-Id: I6f2c9d479125309d16b95df0236715c9353e8ba0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157133
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'starmath/qa')
0 files changed, 0 insertions, 0 deletions