https://bugs.documentfoundation.org/show_bug.cgi?id=174350
Bug ID: 174350
Summary: FILEOPEN DOCX smart justify: text exceeds right margin
in tabulated lines with multiple text portions
(regression from tdf#164499)
Product: LibreOffice
Version: 25.2.2.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Blocks: 166165
Created attachment 209557
--> https://bugs.documentfoundation.org/attachment.cgi?id=209557&action=edit
input that triggers the problem
Since 25.2.2, the first line of a justified DOCX paragraph that contains a tab
(e.g. a numbered clause "1.2<TAB>text" with a hanging indent, typed or from
list numbering) overflows the right margin when the text after the tab consists
of several text portions (e.g. bold/italic words). The line break is the same
as in 25.2.1, but the spaces are no longer shrunk, so the last word extends
past the margin. Only these tabulated lines are affected; other lines of the
same paragraphs are fine.
Steps to reproduce:
1. Open the attached smart-justify-tab-overflow.docx (Word 2013+ compatibility
mode 15, Carlito 11pt, justified, A4 with 1" margins, clauses "N.N<TAB>text"
with a 0.5" hanging indent, random bold/italic words).
2. Export as PDF (or look at the right margin of page 1, line "…company at one
payment").
Actual result: in 3 lines the last word exceeds the right margin, by up to
3.3pt (comparison.png). With Calibri and our real contract templates it is up
to 8pt.
Expected result: the lines stay within the margin, as in 25.2.1.2 (spaces
shrunk) and in MS Word.
Overflowing lines in the attached document (headless `--convert-to pdf`, stock
x86_64 debs on Debian bookworm, only Carlito/DejaVu installed):
- 24.2.7.2, 24.8.7.2, 25.2.0.3, 25.2.1.2: 0
- 25.2.2.2, 25.8.7.3, 26.2.6.3, 26.8.2.2: 3 (max 3.34pt)
Narrowing it down (on a larger version of the same test document):
- Text after the tab in a single text portion: no overflow.
- Several runs with identical formatting (merged into one portion): no
overflow.
- Word list numbering (number + tab from numbering) with several portions:
overflows too.
- List numbering with `w:suff="space"` (no tab): no overflow.
- compatibilityMode 14: no overflow.
Probable cause: commit ed7fbfce0b434f7d2a5542483d2838af51958e34 "tdf#164499 sw
smart justify: disable in tabulated lines to fix ToC" (25.2 backport
55830c147b), the only change in 25.2.1.2..25.2.2.2 that matches the trigger. It
disables shrinking in SwTextPortion::Format_ only when the immediately
preceding portion is in a tab group (`!rInf.GetLast() ||
!rInf.GetLast()->InTabGrp()`). A later text portion of the same line (after a
formatting change) still breaks the line with shrinking, while the tabulated
line is then justified without shrinking. I bisected by release builds and
inspected the code, not by bibisect, so tdf#164905 (434af9dea64f, same release
range, itradj.cxx) is not ruled out.
Referenced Bugs:
https://bugs.documentfoundation.org/show_bug.cgi?id=166165
[Bug 166165] [META] DOCX (OOXML) issues related to the smart justify feature
--
You are receiving this mail because:
You are the assignee for the bug.