Bug 85435 - FILEOPEN: line spacing wrong in DOC file (because GRID forces ADD_EXT_LEADING to false)
Summary: FILEOPEN: line spacing wrong in DOC file (because GRID forces ADD_EXT_LEADING...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:25.2.0
Keywords: filter:doc
: 144865 (view as bug list)
Depends on:
Blocks: CJK Text-Grid DOC-Paragraph
  Show dependency treegraph
 
Reported: 2014-10-25 11:52 UTC by Buovjaga
Modified: 2024-09-20 09:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
85435_min.doc: 2 page minimal reproducer (54.00 KB, application/msword)
2023-05-29 15:30 UTC, Justin L
Details
85435_min.docx (7.83 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-05-29 16:07 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2014-10-25 11:52:26 UTC
DOC file: https://bugs.freedesktop.org/attachment.cgi?id=108383
First reported bug related to this file: https://bugs.freedesktop.org/show_bug.cgi?id=85430
PDF export using 4.4.0.0 alpha1 from Oct 24: https://bugs.freedesktop.org/attachment.cgi?id=108384
PDF export using Word 2010: https://bugs.freedesktop.org/attachment.cgi?id=108385

Problem: line spacing is wrong throughout the whole document starting from page 2.
Comment 1 A (Andy) 2014-10-25 12:38:58 UTC
Reproducible already with LO 4.3.2.2 (Win 8.1):
Line Spacing in WRITER and exported PDF is different to the Word 2010 pdf.
Comment 2 Xisco Faulí 2015-09-09 13:54:09 UTC
This issue is still present in

Version: 5.0.1.2
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: es-ES (es_ES)

on Windows 7 (64-bit)
Comment 3 QA Administrators 2016-09-20 10:29:23 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2017-11-03 17:39:44 UTC
Still confirmed.

Paragraph formatting has Line spacing: Fixed of 22 pt in LibreOffice.

Arch Linux 64-bit, KDE Plasma 5
Version: 6.0.0.0.alpha1+
Build ID: 64024d7c18bd114eb9958cf80eea9129e09923bd
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 3rd 2017

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 5 QA Administrators 2018-11-04 03:58:06 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2019-08-09 09:09:16 UTC Comment hidden (obsolete)
Comment 7 Justin L 2020-04-18 19:03:59 UTC
This is SUPPOSED to have fixed line spacing of 22.  However, if you change it to 82, nothing happens. So it isn't actually showing with spacing of 22 either. Bizarre.
repro 7.0+
Comment 8 QA Administrators 2022-04-19 03:26:32 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2022-04-19 05:36:39 UTC
Still confirmed

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 216493f32236f0086f4c5b527deb18b020b0ed1c
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 19 April 2022
Comment 10 Justin L 2023-05-29 15:30:10 UTC
Created attachment 187585 [details]
85435_min.doc: 2 page minimal reproducer

repro 7.6+
repro OOo 3.3 - both DOC and DOCX look the same in OOo.

line spacing does not show up in the style inspector.
The property name in is ParaLineSpacing.

It looks right in DOCX. However, even there things are very puzzling. This is based on direct paragraph formatting - not styles. 

<w:spacing w:line="440" w:lineRule="exact"/>
Comment 11 Justin L 2023-05-29 15:44:38 UTC
Perhaps a clue? The DOCX version of minimal previously honoured the spacing until LO 7.0 commit 3cd3ae30217a80449799d7d9426c3756c572712e
Author: Michael Stahl on Tue Apr 14 18:10:53 2020 +0200
    writerfilter: DOCX import: import w:noLeading as AddExternalLeading
Comment 12 Justin L 2023-05-29 16:07:41 UTC
Created attachment 187588 [details]
85435_min.docx

Not a very good clue. Changing it to the opposite value in DOC has no effect.

- m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ADD_EXT_LEADING, !m_xWDop->fNoLeading);
+ m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ADD_EXT_LEADING, m_xWDop->fNoLeading);
Comment 13 Justin L 2023-05-29 17:03:26 UTC
Probably started with the work donein ww8par6.cxx for 
commit 9688e60d80a8723bae225f33439788299c69a23c
Author: Oliver Bolte on Tue Jan 13 16:15:04 2004 +0000

but interestingly enough, the conclusion was toggled a couple years later with 
commit 5d9e113309bd426b9582a7f58a18721058db71ea
Author: Jens-Heiner Rechtien on Wed Nov 19 16:29:07 2008 +0000
    CWS-TOOLING: integrate CWS sw301bf02_DEV300

    if (eType != GRID_NONE)
       ...(DocumentSettingId::ADD_EXT_LEADING, false);
Comment 14 Justin L 2023-06-29 20:53:08 UTC
In https://gerrit.libreoffice.org/c/core/+/152375 I suggest just reverting that part, but what do I know about the grid?
Comment 15 Buovjaga 2024-09-09 18:16:30 UTC
*** Bug 144865 has been marked as a duplicate of this bug. ***
Comment 16 Jonathan Clark 2024-09-19 22:59:30 UTC
(In reply to Justin L from comment #13)
> Probably started with the work donein ww8par6.cxx for 
> commit 9688e60d80a8723bae225f33439788299c69a23c
> Author: Oliver Bolte on Tue Jan 13 16:15:04 2004 +0000
> 
> but interestingly enough, the conclusion was toggled a couple years later
> with 
> commit 5d9e113309bd426b9582a7f58a18721058db71ea
> Author: Jens-Heiner Rechtien on Wed Nov 19 16:29:07 2008 +0000
>     CWS-TOOLING: integrate CWS sw301bf02_DEV300
> 
>     if (eType != GRID_NONE)
>        ...(DocumentSettingId::ADD_EXT_LEADING, false);

The original version of this code was a quick and dirty fix for bug 129808. Due to missing context I'm not entirely sure what problem flipping the value solved, but it's easy to imagine the original code causing issues.

In my opinion, this code should be deleted.
Comment 17 Commit Notification 2024-09-20 09:19:18 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2b030ded43f440a898733290af087d4aeed53368

tdf#85435 sw: No longer clear AddExtLeading for doc files with grid

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 18 Jonathan Clark 2024-09-20 09:22:14 UTC
I've removed the old workaround.

I don't expect this will introduce new text grid problems, but if it does, we can address them in a more permanent way.