diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-01-03 16:52:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-01-04 13:46:16 +0100 |
commit | 21abead6dbb143c291db0a49270e658a3e279d27 (patch) | |
tree | 121ebc6e187e44d322d15c95ce2134ef66aabadc /xmloff | |
parent | 56ae4e455d6a8ac2116700c7b8913d64c665f362 (diff) |
tdf#158999 sw: fix bad zero text frame height with no text and auto superscript
The problem was that the bugdoc had an empty paragraph with superscript
(as char format) enabled and that was simply lost in the layout. Adding
text to the paragraph or removing the superscript formatting worked
around the problem.
What happened is that SwSubFont::GetHeight() has a somewhat surprising
explicit check for escapement, and there the CalcEscHeight() call might
be invoked on an SwSubFont whose m_nOrgHeight is 0, while the intent is
to just return the original height in case of automatic subscript or
superscript.
Fix the problem by checking the result of GetDefaultAscentAndHeight() in
SwLineLayout::CalcLine(), and in case it would simply turn the line into
an invisible one for an empty line with sub/subscript then go back to
the already correctly calculated line height.
This needed adjusting a test in CppunitTest_sw_ooxmlexport12 because the
bugdoc there had such a paragraph, effectively testing if we lose
content during layout, which is not wanted.
(cherry picked from commit ae974a9928aa435316f15626642d41c5dddafe99)
Change-Id: I1e836531851ea5c9a983ae69da5be8a042cc6e39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161606
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'xmloff')
0 files changed, 0 insertions, 0 deletions