Bug 164905 - LAYOUT: ToC tabstops not properly lining up the contents/page numbers (particular document - see comment 5)
Summary: LAYOUT: ToC tabstops not properly lining up the contents/page numbers (partic...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Paragraph Paragraph-Alignment DOCX-compatibilityMode-15
  Show dependency treegraph
 
Reported: 2025-01-29 00:40 UTC by Justin L
Modified: 2025-03-03 15:50 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
forum-mso-de-116948.docx: example document (45.73 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-01-29 00:40 UTC, Justin L
Details
forum-mso-de-116948.docx_mso.pdf: how it looks in Word 2019 (145.16 KB, application/pdf)
2025-01-29 00:41 UTC, Justin L
Details
forum-mso-de-116948.docx_bad_layout.pdf: how it looks in LibreOffice (99.31 KB, application/pdf)
2025-03-03 13:22 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-01-29 00:40:22 UTC
Created attachment 198830 [details]
forum-mso-de-116948.docx: example document

The ToC on the first two pages is ragged - in the contents and also (by extension) in the page numbers.

This started in 25.2 with commit f806fc136b3410ec9a1e09320d100c78b33c867b
Author: Oliver Specht on Thu Jun 13 14:49:16 2024 +0200
    tdf#137335 calculate paragraph height in RTF/DOCX

Steps to reproduce: 
1.) open forum-mso-de-116948.docx

Noticed that the page numbers in the table of contents are not nicely lined up.

Found by Collabora's mso-test
Comment 1 Justin L 2025-01-29 00:41:10 UTC
Created attachment 198831 [details]
forum-mso-de-116948.docx_mso.pdf: how it looks in Word 2019
Comment 2 Justin L 2025-01-29 00:49:16 UTC
I'm noticing that any content containing a space is causing the separate words to overlap.
Comment 3 Justin L 2025-01-29 01:47:51 UTC
I think the key differentiator with this document is that the page numbers are tabOverMargin - placed beyond the page margin.
Comment 4 raal 2025-02-17 20:22:17 UTC
confirm Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7da1497aa462e2b719aa9b308a749caf7b9a19b1
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 5 Gabor Kelemen (allotropia) 2025-03-03 10:07:07 UTC
Hi Justin

I got some different source from bibisect-252-linux:

https://git.libreoffice.org/core/+/857dd6000c877f2c6d8bb73806a8557fa0baea73%5E%21

commit 857dd6000c877f2c6d8bb73806a8557fa0baea73	[log]
author	László Németh <nemeth@numbertext.org>	Mon Sep 16 13:36:41 2024 +0200
committer	László Németh <nemeth@numbertext.org>	Tue Sep 17 09:18:57 2024 +0200
tree b4179656345bce84361f3a0d79a35a493c4182db
parent 29d6065d9a687f1d86f26f53587e108f8c951a4a [diff]

tdf#161810 sw smart justify: fix overhanging lines containing tabs

Can you double check if it's correct?
Comment 6 László Németh 2025-03-03 12:27:37 UTC
@Gábor, Justin: it seems, reverting my commit fixes the problem, and my commit has already got a better fix in Bug 164499, so I am going to revert it in the master, too. Thanks for the investigation and report!
Comment 7 László Németh 2025-03-03 13:22:59 UTC
Created attachment 199577 [details]
forum-mso-de-116948.docx_bad_layout.pdf: how it looks in LibreOffice
Comment 8 László Németh 2025-03-03 13:23:45 UTC
Proposed fix: https://gerrit.libreoffice.org/c/core/+/182433
Comment 9 Commit Notification 2025-03-03 15:29:46 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/434af9dea64f95e1d5f93a5563106b9124bb17af

tdf#164905 tdf#164499 sw smart justify: fix overlapping text in ToC

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Justin L 2025-03-03 15:50:39 UTC
The correct bisect - in comment 5 - was backported to 24.2.7.