diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-10-18 08:52:44 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-10-18 14:20:37 +0200 |
commit | 626fe9ab5ebebc4ef36e35f4aa597c03a3564d22 (patch) | |
tree | 967d95c80ce9813463f116f49cfa9b7812a620e5 /package | |
parent | ae17d08c116e5865ba5448edfb415ea2d3f87c19 (diff) |
tdf#157573 sw floattable: fix incorrect lack of left margin after table
Regression from d477fa8ac1b0d3ee81427217bbb5950278ab16db (sw floattable:
unconditionally map <w:tblpPr> to SwFormatFlySplit, 2023-03-17), the
paragraph after the anchor of the floating table in the document lost
its left paragraph margin at a layout level.
Turns out the problem was there earlier, but it was hidden for this
specific document, because we used to map DOCX floating tables to Writer
inline tables in some cases before. The real problem was introduced
earlier, in my 50a1df360c907d8419ce49f098b6bc87a37a9956 (n#775899 sw:
add FloattableNomargins compat flag, 2012-08-23), even a TODO was added
to point out this will be problematic. The old bugdoc wants to get rid
of margins, because the floating table is already shifting text towards
the right, the new bugdoc wants to keep the original margin as the
paragraph after the anchor is not wrapping.
Fix the problem by reverting the older fix and re-fix the old document
differently. Don't do changes to the paragraph margin: that's not a good
idea. If there is enough anchor text, it'll lead to a visibly bad
paragraph margin anyway. Instead of reducing the paragraph margin,
reduce the width of the fly portion in the paragraphs that intersect
with the floating table. That's reasonly straightforward to do, because
SwTextFormatter::CalcFlyWidth() already has a case when we know we're
intersecting with a floating table and we also know that the floating
table is aligned to the left. In this case we can simply reduce the fly
portion width with the paragraph margin. This keeps the old bugdoc fixed
and fixes the new bugdoc.
It also means that DocumentSettingId::FLOATTABLE_NOMARGINS is now
effectively unused, but that's not yet removed in this change.
Change-Id: Ibaccc4807fd8c11bd45955b76e96cd4a5e55976f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158103
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'package')
0 files changed, 0 insertions, 0 deletions