Bug 96277 - [FORMATTING] spacing above and below a table incorrect in specific .doc-file
Summary: [FORMATTING] spacing above and below a table incorrect in specific .doc-file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: high normal
Assignee: Justin L
URL:
Whiteboard: interoperability target:5.4.0 target:...
Keywords: bibisected, bisected, filter:doc, regression
Depends on:
Blocks:
 
Reported: 2015-12-06 00:25 UTC by Ari Latvala
Modified: 2018-10-09 10:44 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF version showing the expected layout (181.77 KB, application/pdf)
2015-12-06 00:25 UTC, Ari Latvala
Details
DOC version having incorrect spacing above on table 1 (47.00 KB, application/msword)
2015-12-06 00:26 UTC, Ari Latvala
Details
screen shot: difference in Writer (left) and PDF from Word (right) (65.41 KB, image/png)
2015-12-06 12:29 UTC, Cor Nouws
Details
bnc863018b.doc: slightly modified version of the unit test from the problematic commit (26.00 KB, application/msword)
2017-01-19 15:59 UTC, Justin L
Details
bnc86018b.pdf: from Word2007 (86.71 KB, application/pdf)
2017-01-19 17:38 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ari Latvala 2015-12-06 00:25:17 UTC
Created attachment 121063 [details]
PDF version showing the expected layout

LibreOffice 5.0.4.1 running on Windows 7 64-bit. Layout incorrect for DOC version of document "Pentutarkistus / Eläinlääkärintodistus" available at http://www.kissaliitto.fi/lomakkeet/rekisterointi

Attached DOC and PDF versions of the same document for comparison. Table 1 table spacing above inccorectly 4.91cm instead of 0cm.
Comment 1 Ari Latvala 2015-12-06 00:26:16 UTC
Created attachment 121064 [details]
DOC version having incorrect spacing above on table 1
Comment 2 Cor Nouws 2015-12-06 12:27:42 UTC
Hi Ari Lavala,

Thanks for you report!

I can confirm that the document doesn't open correctly.

Between the header and the first table and after the first table there is spacing. The rest is pushed to the next page.

I will attach a screen shot.

I see the problem in a recent daily build, 5.1.0.beta1, 4.2.8 but the file is OK in 3.3.0, 400rc1.
So it is a regression somewhere..

Cheers,
Cor
Comment 3 Cor Nouws 2015-12-06 12:29:05 UTC
Created attachment 121075 [details]
screen shot: difference in Writer (left) and PDF from Word (right)
Comment 4 Joel Madero 2015-12-12 23:24:26 UTC
 61023f2c6c2d5a7c36b6a410b041e8aa397c59d8 is the first bad commit
commit 61023f2c6c2d5a7c36b6a410b041e8aa397c59d8
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Mar 14 20:09:29 2015 +0800

    source-hash-3755c87d0426a499d4755e82d8fbc77caa240764
    
    commit 3755c87d0426a499d4755e82d8fbc77caa240764
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    AuthorDate: Mon May 26 12:04:39 2014 +0200
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Mon May 26 12:20:47 2014 +0200
    
        bnc#863018 WW8 import: fix upper margin of multi-page floating table
    
        A vert orient position was already handled in case a floating table was
        imported as a TextFrame, but in case we didn't do that, the vert orient
        position was simply lost.
    
        Fix this by importing it as the upper margin of the table (assuming that
        the position is relative from the anchor position).
    
        Change-Id: I3e96f3068605fd6313dfb3e55483e1bce6c063a5

:040000 040000 9ec9ec8666008daa3a9dace7c3fff4006ab86d58 27c0461e0ea1c6bc9ed7ce8c95a592f235439a87 M	opt


# bad: [cf6ea17155fabb2a120ba07c150735591ac861d7] source-hash-3f94c9e9ddfd807b449f3bb9b232cf2041fa12d2
# good: [fc71ac001f16209654d15ef8c1c4018aa55769f5] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
git bisect start 'latest' 'oldest'
# bad: [8cf60cc706948588e2f33a6d98b7c55d454e362a] source-hash-f340f0454627939f1830826fb5cc53a90e6c62a4
git bisect bad 8cf60cc706948588e2f33a6d98b7c55d454e362a
# bad: [d9885f526fc7a09cc8f9f8ee643af1b966be24bb] source-hash-d1465c64c6f64ad8dd25e40cdc69649b24b305ea
git bisect bad d9885f526fc7a09cc8f9f8ee643af1b966be24bb
# bad: [e3eab511ffbcd2e1e2c67e7a4fec162bb0b26b7a] source-hash-dc9cc46f3223aff3f85d3ce9696178a5f4d3d087
git bisect bad e3eab511ffbcd2e1e2c67e7a4fec162bb0b26b7a
# bad: [abcc1a4b07f3ef8bfeeed62b1902d8ba927e21d6] source-hash-aa48af57531851a16204381854f1ee19ebb63a6a
git bisect bad abcc1a4b07f3ef8bfeeed62b1902d8ba927e21d6
# good: [d993382687e6c349bb91f9e023bb323ad6601a19] source-hash-2448ed63610dffa54d4ec988628a3f7e29a3ecf4
git bisect good d993382687e6c349bb91f9e023bb323ad6601a19
# good: [37b67dba760dff2566d7d6d81c6e60c559ba9124] source-hash-83f760d566d61a563025ec0ca38a2f9793e0d211
git bisect good 37b67dba760dff2566d7d6d81c6e60c559ba9124
# bad: [13073f467d446b70956905b9bca85a387daca928] source-hash-25cea66f6ac06897379b6d98fdf2e443e1d3e001
git bisect bad 13073f467d446b70956905b9bca85a387daca928
# skip: [778d2210f57c434c625aa50eadfc35c32ab4277a] source-hash-3381dfec2c7e601ecd3d71725ecba184bd5b7cae
git bisect skip 778d2210f57c434c625aa50eadfc35c32ab4277a
# bad: [c1de159ea531884197b335b1738f1432631b19f6] source-hash-318ffa88240f55adef906df673614123d19f35a3
git bisect bad c1de159ea531884197b335b1738f1432631b19f6
# bad: [e27c95edf42cd783c077e5ffcf5e3d9faedf5492] source-hash-d8f958a201a8c6320684ad2e03fd15dfba818520
git bisect bad e27c95edf42cd783c077e5ffcf5e3d9faedf5492
# good: [972e54d85285a4bbcabc9bf5420fb896e0d38a29] source-hash-5b2aaefb896dfe50d9cd1551ef46cacaddcf92b7
git bisect good 972e54d85285a4bbcabc9bf5420fb896e0d38a29
# good: [bec60ae374ca7e88c85ac49500338403815380fc] source-hash-a84173738175a07429278b9010f1fbcf70aac74c
git bisect good bec60ae374ca7e88c85ac49500338403815380fc
# bad: [61023f2c6c2d5a7c36b6a410b041e8aa397c59d8] source-hash-3755c87d0426a499d4755e82d8fbc77caa240764
git bisect bad 61023f2c6c2d5a7c36b6a410b041e8aa397c59d8
# good: [347df710b3e03def48c7c89577e25bda0afb8ef7] source-hash-09c0a96eb3ea8d48e99ed50ae7d13d23f70a0c6c
git bisect good 347df710b3e03def48c7c89577e25bda0afb8ef7
# first bad commit: [61023f2c6c2d5a7c36b6a410b041e8aa397c59d8] source-hash-3755c87d0426a499d4755e82d8fbc77caa240764
Comment 5 Ari Latvala 2016-02-13 23:42:36 UTC
Problem still exists on LO 5.1.0.3 on Windows 7 64-bit.
Comment 6 Ari Latvala 2016-03-14 21:55:13 UTC
Problem still on LO 5.1.1.3 for Windows 7 SP1 64-bit.
Comment 7 Ari Latvala 2016-06-02 20:16:52 UTC
Problem still exists on the latest LO 5.2 Beta 1 for Windows 7 SP1 64-bit
Comment 8 Aron Budea 2016-09-01 05:59:26 UTC Comment hidden (obsolete)
Comment 9 Timur 2016-09-26 16:35:07 UTC Comment hidden (obsolete)
Comment 10 Justin L 2016-12-24 09:13:37 UTC
Reopening, since the fix for bug 81263 did not fix this.

Setting the first version affected as 4.4alpha since that actually came before 4.2.8.
Comment 11 Justin L 2017-01-19 08:21:11 UTC
> Fix this by importing it as the upper margin of the table 
> (assuming that the position is relative from the anchor position).
This is an example where the assumption is incorrect. The table is vertically positioned 2.41 cm from the (top) margin (above the header).
Comment 12 Justin L 2017-01-19 15:59:54 UTC
Created attachment 130559 [details]
bnc863018b.doc: slightly modified version of the unit test from the problematic commit

I think I'll be recommending pretty much a complete revert of the problematic commit.  It only works under the assumption that there is nothing in the ULSpace defined, but that is a very bad assumption as this modified unit test shows.
Comment 13 Justin L 2017-01-19 17:38:38 UTC
Created attachment 130560 [details]
bnc86018b.pdf: from Word2007

proposed fix https://gerrit.libreoffice.org/33322 tdf#96277 revert ww8 import: fix upper margin of floating table
Comment 14 Commit Notification 2017-01-23 09:18:35 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=895f4bc27d518ecaa054d812fa6c24fd4301d327

tdf#96277 revert ww8 import: fix upper margin of floating table

It will be available in 5.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2017-01-25 20:36:09 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a47cada052427bc5cf6123b11e3643a3a8a8516a&h=libreoffice-5-3

tdf#96277 revert ww8 import: fix upper margin of floating table

It will be available in 5.3.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 vihsa 2017-03-01 03:13:22 UTC
verified. Version: 5.4.0.0.alpha0+
Build ID: febc116

the spacing above & below a table is showing correctly or similar to attached PDF file.