Bug 156146 - FILEOPEN ODT Paragraphs have greater indent than in 7.5
Summary: FILEOPEN ODT Paragraphs have greater indent than in 7.5
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: odf target:24.2.0 target:7.6.3 target...
Keywords: bibisected, bisected, regression
: 157189 (view as bug list)
Depends on:
Blocks: Bullet-Number-Outline-Lists
  Show dependency treegraph
 
Reported: 2023-07-03 15:00 UTC by Gabor Kelemen (allotropia)
Modified: 2024-04-22 15:51 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer (44.40 KB, application/vnd.oasis.opendocument.text)
2023-07-03 15:00 UTC, Gabor Kelemen (allotropia)
Details
The example file in 7.5 bibisect and 7.6 bibisect master (366.16 KB, image/png)
2023-07-03 15:01 UTC, Gabor Kelemen (allotropia)
Details
numbering style settings are the same in both versions (270.46 KB, image/png)
2023-07-03 15:06 UTC, Gabor Kelemen (allotropia)
Details
The example file in LO 7.6 and Word 2016 (228.79 KB, image/png)
2023-08-31 12:14 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-07-03 15:00:59 UTC
Created attachment 188189 [details]
Example file from Writer

Attached simple file contains some numbered paragraphs.
In 7.6 they have a lot more indent than in 7.5 and older.

1. Open attached file
-> Numbered paragraphs have 1.33 cm left indent and -0.7 cm first line indent instead of 0 and 0.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ade0a153f453500f15343380ac937252992733e0
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded

Started with:

https://git.libreoffice.org/core/+log/ade0a153f453500f15343380ac937252992733e0

author	Michael Stahl <michael.stahl@allotropia.de>	Mon Feb 27 20:52:39 2023 +0100
committer	Michael Stahl <michael.stahl@allotropia.de>	Tue Feb 28 15:43:40 2023 +0000

tdf#114287 xmloff: ODF import: fix text:list override of list style
Comment 1 Gabor Kelemen (allotropia) 2023-07-03 15:01:54 UTC
Created attachment 188190 [details]
The example file in 7.5 bibisect and 7.6 bibisect master
Comment 2 Gabor Kelemen (allotropia) 2023-07-03 15:06:04 UTC
Created attachment 188191 [details]
numbering style settings are the same in both versions
Comment 3 Michael Stahl (allotropia) 2023-08-11 16:23:44 UTC
this is exactly the case that was fixed with bug 114287.

hmm... it was not what the bug was filed for though, there was a bit of confsion going on there, unfortunately the info is only in a mail, let me translate it...

<mail>
Regina:
>
> For the attached [note: (2) is the case being discussed below]:
>
> Word MS Office 365:(1) paragraph-Indent (2)(3) List-Indent
> TextMarker, SoftMaker 2021: (1)(2)(3) mit paragraph-Indent
> OnlyOffice 7.3.0.184: (1) paragraph-Indent, (2)(3) List-Indent
> Google Docs: (1) paragraph-Indent, (2)(3) List-Indent
> LO 7.6: (1)(2) paragraph-Indent, (3) List-Indent
>
> This does not look good.

so this was a bit confusing but i found out that this (2) is a special case that our ODF import handles wrongly - if the list style referenced by the paragraph style and the one used by the list are different, the problem does *not* occur.

> 19.880.22  <text:list>
> The text:style-name attribute specifies the name of a list style that is applied to a list.
> If this attribute is not included and therefore no list style is specified, one of the following actions is taken:
>     • If a list is contained within another list, the list style defaults to the style of the surrounding list.
>     • If there is no list style specified for the surrounding list, but the list's list items contain paragraphs that have paragraph styles attached specifying a list style, that list style is used.     • An implementation-dependent default list style is used.
> To determine which formatting properties are applied to a list, the list level and list style name are taken into account. 

    ^ this takes precedence over paragraph / paragraph-style!

fix:   https://gerrit.libreoffice.org/c/core/+/147930
</mail>


... so this was a fix to do the same thing that Word and Google Docs and OnlyOffice do, in accordance with ODF.

if i open the attachment here with Word 2013 it shows the same as the Writer 7.6 does now.

one thing i wonder though: i think this document was artificially constructed by Regina, and we (at least i) had assumed that this would basically be non-existing in user-created documents. do we have any idea if this is a common thing, or is this just one document out of a million?
Comment 4 Gabor Kelemen (allotropia) 2023-08-31 12:11:46 UTC
Well, looking into this more and how it was made:
- Custom para style, with Numbering 123 list style and Outline level 1
-> this caused 1.33 cm indent Before text and -0.7 cm First line. 
- These were then set to zero in the para style settings
then this applied to some paragraphs: it looks like no indent, only numbering in 7.4.

So not entirely hand-crafted in text editor, but something possible in the UI.

However I can confirm that in Word 2016 this example file and my local recreation (documented above) looks like in 7.6.
So there is a layout change, but I'd agree to call it an improvement.
Comment 5 Gabor Kelemen (allotropia) 2023-08-31 12:14:38 UTC
Created attachment 189288 [details]
The example file in LO 7.6 and Word 2016
Comment 6 Michael Stahl (allotropia) 2023-09-14 11:32:26 UTC
*** Bug 157189 has been marked as a duplicate of this bug. ***
Comment 7 Commit Notification 2023-09-28 20:53:21 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7cf5faec6fdbc27dd77d2d36fb2ff205322cba0d

tdf#156146 xmloff: ODF import: add backward compatibility hack

It will be available in 24.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 8 Michael Stahl (allotropia) 2023-09-29 09:54:22 UTC
have added some non-obvious backward compatibility fix that applies the paragraph or paragraph style left margin/first-line-indent in the situation when the list style is also applied, so that documents stored with LO < 7.6 look the same when loaded.
Comment 9 Commit Notification 2023-10-07 18:47:49 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/4db3cdb9536594ee2b2700e63d4f0f98983814aa

tdf#156146 xmloff: ODF import: add backward compatibility hack

It will be available in 7.6.3.

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 Commit Notification 2024-04-19 16:12:42 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0c7ae3bd96130eaa400d55a3ba9bf1e2fe6600de

tdf#156146 tdf#159903 sw: add unit tests

It will be available in 24.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 11 Commit Notification 2024-04-22 15:51:04 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/2545b0885bdd269b4937ed9ef4813ed5597d71cc

tdf#156146 tdf#159903 sw: add unit tests

It will be available in 7.6.8.

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

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

tdf#156146 tdf#159903 sw: add unit tests

It will be available in 24.2.4.

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.