Bug 162121 - 24.2.5 Writer: long text in alphabetical index entry flows through margin, does not wrap to next line
Summary: 24.2.5 Writer: long text in alphabetical index entry flows through margin, do...
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:25.2.0 target:24.8.1 target:24...
Keywords: bisected
Depends on:
Blocks: Concordance-File
  Show dependency treegraph
 
Reported: 2024-07-21 03:40 UTC by Sam
Modified: 2024-09-26 13:55 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
24.2.5 index entry overflows column margin without wrap (31.14 KB, image/png)
2024-07-21 03:45 UTC, Sam
Details
24.2.4 index entry text correctly wraps to next line (44.83 KB, image/png)
2024-07-21 03:48 UTC, Sam
Details
test odt to reproduce the stated error (312.12 KB, application/vnd.oasis.opendocument.text)
2024-07-23 20:48 UTC, Sam
Details
image of error in test file as seen in my system (50.29 KB, image/png)
2024-07-23 20:49 UTC, Sam
Details
test result of 24.2.6 daily - problem not fixed (173.80 KB, image/jpeg)
2024-08-18 15:20 UTC, Sam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam 2024-07-21 03:40:15 UTC
Description:
Official LibreOffice package 24.2.5 installed from LibreOffice Fresh PPA: When creating text in an alphabetical index entry that is longer than the index column width, the text flows through the margin into the page area - or right off the page instead of wrapping to the next line.

Steps to Reproduce:
1. Create alphabetic index
2. Create a long index name and/or enough individual index links to fill the index entry
3. Update the index

Actual Results:
Index entry text flows through the index column margin without wrapping.
Example ( # is column margin):
#Jarrell, John (son of James 'The Elder')165,# 172
see attachment

Expected Results:
Text should wrap at the margin.
#Jarrell, John (son of James 'The Elder')165,#
172
see attachment


Reproducible: Always


User Profile Reset: No

Additional Info:
The problem does not occur in 24.2.4 or previous releases - text flows/wraps properly to next line. This is being reported on a Linux Mint 21.3 (Ubuntu 22.04) system, but problem is also confirmed on Windows 7 and Ubuntu 24.04.

Downgrading from LibreOffice 24.2.5 to 24.2.4 resolves the regression, but downgrading IS NOT EASY when using the LibreOffice Fresh PPA! The PPA code must be entirely removed and replaced by a manual install.
Comment 1 Sam 2024-07-21 03:45:45 UTC
Created attachment 195412 [details]
24.2.5 index entry overflows column margin without wrap
Comment 2 Sam 2024-07-21 03:48:09 UTC
Created attachment 195413 [details]
24.2.4 index entry text correctly wraps to next line
Comment 3 raal 2024-07-21 06:00:23 UTC
Please attach test file. Thank you.
Comment 4 Sam 2024-07-22 04:30:58 UTC
Due to Intellectual Property concerns, I can not give you the entire 330+ page book in progress. Instead I tried creating small new files with multiple index entries on both 24.2.4 and 24.2.5 systems. All my test files work correctly on 24.2.5 - line wrap occurs.

My guess, then, is there is a contamination in the book file that previous LO releases ignored but 24.2.5 either can not handle or misinterprets as "no wrap". You might argue this is not a LO problem, nonetheless erroneous output is created when there is/was no change to the input data, and the only change is the LO code handing the file.

The book file was first created in LO over 4 years ago - many releases ago. No errors have appeared until 24.2.5. I do not know how to investigate where the problem is in the index handling. I will also mention the problem seems to occur only in the alphabetical index. Overlap lines in the Table of Figures do wrap correctly!

Is there any way to look for a corruption in the specific index entries?
I will try to regenerate a new full book file in 24.2.5 by copying segments and testing as I go. There is a LOT of formatting to deal with. This may take a week or more. Any advice is welcome.
Comment 5 Sam 2024-07-23 20:45:02 UTC
Finally got clearance from IP concerns to submit a 10 page sample of the book which generates the error in 24.2.5. See attached test file. Also see attached image showing what *I* see when I run it. The error is for "Jarrell, John (son of James 'The Elder')

I looked though all the changelog entries for 24.2.5 and found one that sounds close to the problem. Bug 158658 - FILEOPEN DOCX/DOC/RTF Tabs closing header paragraph are wrapped and not flowing outside the page area.

The change was made to allow flow through the margins. Is this problem a side effect of that change? (alphabetical index is not mentioned in that change.)
Comment 6 Sam 2024-07-23 20:48:27 UTC
Created attachment 195463 [details]
test odt to reproduce the stated error
Comment 7 Sam 2024-07-23 20:49:55 UTC
Created attachment 195464 [details]
image of error in test file as seen in my system
Comment 8 David Legg 2024-07-27 10:03:05 UTC
Just confirmaton that this bug is also manifesting itself in Fedora 40, in:
libreoffice* 24.2.5.2-2.fc40
Comment 9 David Legg 2024-07-27 10:06:22 UTC
I should also say that the bug is reliably reproducable even when I re-create a table from scratch, so it is not simply about corruption from previous releases.
Comment 10 Robert Großkopf 2024-07-27 19:25:00 UTC
Could confirm the buggy behavior with
Version: 24.2.5.2 (X86_64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

See row 6 on the right in index: 
Jarrell, John (son of James 'The Elder')	5, 7, 8
'8' appears in right border of the page.

Same buggy behavior in LO 24.8.0.1 on the same system.

Works well in
Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 11 gladys 2024-08-02 17:59:43 UTC
bibisection with windows 10 seem to point to commit 

commit: 10d753b8aadb50ec4309551b97d4cf2163ea3e3d	
author:	Michael Stahl <michael.stahl@allotropia.de>	
Date: Thu Jun 13 2024 12:59

commit mesage: 
tdf#158658 sw: text formatting: try to make TabOverMargin more crazy

... to better match Word's formatting; this commit is not based on a
complete diagnosis of Word's compatibility-mode tab-in-margin
formatting disorders.
Comment 12 Commit Notification 2024-08-07 13:29:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0633189fabe85f73062ff2ce67b5f40af7d3f504

tdf#162121 sw: fix tab stop position in columned ToX

It will be available in 25.2.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 13 Michael Stahl (allotropia) 2024-08-07 13:36:43 UTC
there are 2 problems:
1. the existing document is formatted differently if TabOverMargins is enabled
2. when the index is updated, the end tab stops in the index are created with a wrong (in the right margin) position if the index content is not directly in the document body, such as in this case where the index has columns

problem 2 is really the root cause and is fixed on master.

problem 1 is ... sort of intentional because that's what Word does, or rather Word does it even worse which you can test by exporting the ODT to "Word 2007" (compatibilityMode 12) DOCX.

so to get the correct layout in such a document you have to "Update" the index.
Comment 14 Commit Notification 2024-08-12 08:15:55 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/6df31a319ac591b885e5dcff1c90433f4481c8fa

tdf#162121 sw: fix tab stop position in columned ToX

It will be available in 24.8.1.

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 15 Commit Notification 2024-08-12 08:15:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/aa4f45f07331f02343b021f118e64252f3bf515e

tdf#162121 sw: fix tab stop position in columned ToX

It will be available in 24.2.6.

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 16 Sam 2024-08-18 15:17:27 UTC
"Affected users are encouraged to test the fix and report feedback."

I do not know how to verify that the committed code is or is not in a particular daily, but the 24.2.6 daily dated 2024-08-17 (5 days after Comment 15 says it will be available in 24 to 48 hours) DOES NOT FIX THE PROBLEM in the test file.

See the result in attachment "LO24.2.6 test result.jpg"

The daily that was tested is: /daily/libreoffice-24-2/Linux-rpm_deb-x86_64@tb99-TDF/2024-08-17_02.49.01/

Also tested the 24.8.0 daily dated 2024-08-18. Same result. Not fixed.

Michael Stahl - did you run against the test file "text.overflow.test.file.odt"?
Comment 17 Sam 2024-08-18 15:20:35 UTC
Created attachment 195891 [details]
test result of 24.2.6 daily - problem not fixed
Comment 18 Michael Stahl (allotropia) 2024-08-19 12:08:09 UTC
did you try to do "Tools->Update->Update All" ?  this is needed to replace the wrongly positioned tab stops which are now formatted in a more Word-compatible way with correctly positioned tab stops.
Comment 19 Sam 2024-08-19 16:30:54 UTC
Ah, I see in Comment 13: "so to get the correct layout in such a document you have to "Update" the index."

You mean update AFTER the index is created when the file is opened. Sorry, I thought the code would process when the index is first built during file open. "Update index" and "Tools>Update>Update All" do reformat it correctly. The problem IS FIXED.

(Please ensure any documentation on this clearly states: update after creation.)

Sincere thank you for your work.
Sam
Comment 20 David Legg 2024-09-26 13:55:08 UTC
I'm sorry to have to report that this is still broken in the latest 24.8 daily build: https://dev-builds.libreoffice.org/daily/libreoffice-24-8/Linux-rpm_deb-x86_64@tb99-TDF/2024-09-26_05.27.01/ i.e. version 24.8.3.0.0

but only in the case of Alphabetical Indexes, not User Defined indexes - which work fine. The overflow of text off to the right of each column in the cases of long, unwrapped, lines looks like identical behaviour to me :(

It is also broken in 24.8.1.1 and 24.8.2.1.