Bug 150769 - Multi page table is mixed as a single page with garbled text
Summary: Multi page table is mixed as a single page with garbled text
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.5.2 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.6.0
Keywords: bisected, implementationError
Depends on:
Blocks: DOCX-Floatingtable
  Show dependency treegraph
 
Reported: 2022-09-04 01:03 UTC by Hossein
Modified: 2023-05-31 08:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The document with a table that spans across multiple pages (86.72 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-09-04 01:03 UTC, Hossein
Details
Output from LibreOffice 7.5 dev master (48.81 KB, application/pdf)
2022-09-04 08:35 UTC, Hossein
Details
Output from LibreOffice 7.2 (43.67 KB, application/pdf)
2022-09-04 08:37 UTC, Hossein
Details
Output from LibreOffice 7.5 dev master on Windows (55.97 KB, application/pdf)
2022-09-04 09:14 UTC, Hossein
Details
Output from MS Word (358.21 KB, application/pdf)
2022-09-04 20:11 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-09-04 01:03:56 UTC
Created attachment 182194 [details]
The document with a table that spans across multiple pages

Description:
The attachment is a docx file containing a single table which spans across multiple pages. In LibreOffice 7.2 and older, the document was loaded correctly. From 7.3, the table is rendered as a single page with garbled text.

Steps to Reproduce:
1. Just open the attachment

Actual Results:
The table is rendered as a single page with garbled text.

Expected Results:
The table should span across multiple pages, and the text should not be garbled and mixed together


Reproducible: Always


User Profile Reset: No


Additional Info:

Reproducible in:

Version: 7.3.6.1 / LibreOffice Community
Build ID: 92b673af3a5e8f7cf4716be88dfaca424612f244
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Calc: threaded

But not reproducible in:

Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Telesto 2022-09-04 08:30:04 UTC
No issue
Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 7a89eae97a970939174d59aa58147eaa194acaee
CPU threads: 8; OS: Mac OS X 12.3.1; UI render: Skia/Metal; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded

Note: font-substitution active
Comment 2 Hossein 2022-09-04 08:35:21 UTC
Created attachment 182195 [details]
Output from LibreOffice 7.5 dev master

I created this from the LibreOffice UI. The output is different when you convert in command line.
Comment 3 Hossein 2022-09-04 08:36:13 UTC
(In reply to Telesto from comment #1)
> No issue
> Version: 7.5.0.0.alpha0+ / LibreOffice Community
> Build ID: 7a89eae97a970939174d59aa58147eaa194acaee
> CPU threads: 8; OS: Mac OS X 12.3.1; UI render: Skia/Metal; VCL: osx
> Locale: nl-NL (nl_NL.UTF-8); UI: en-US
> Calc: threaded
> 
> Note: font-substitution active

Do you use command line, or you open the file in the LibreOffice UI?
Comment 4 Hossein 2022-09-04 08:37:53 UTC
Created attachment 182196 [details]
Output from LibreOffice 7.2

This is the output from LibreOffice 7.2, which is OK.
Comment 5 Hossein 2022-09-04 09:14:47 UTC
Created attachment 182197 [details]
Output from LibreOffice 7.5 dev master on Windows

I have tested the file on LibreOffice 7.5 dev master on Windows, the same problem is reproducible on Windows:

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f0fbf30a9c9dab41fce10f3ad4bfc83434122c70
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded
Comment 6 m_a_riosv 2022-09-04 09:24:21 UTC
Open fine for me
Version: 7.4.1.1 (x64) / LibreOffice Community
Build ID: 0a046a10cbf1679eea5538bd3ab63156caa3a036
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL
Comment 7 Hossein 2022-09-04 10:31:27 UTC
To clarify:

The good output consists of a 2 page PDF file with clear visible text, like attachment 182196 [details].

The bad output consist of only 1 page PDF file with garbled text, like attachment 182197 [details].
Comment 8 Roman Kuznetsov 2022-09-04 10:48:57 UTC
no problem in

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: dc92a4d973086ce8a6a5f75ba0f4d4c9ca05537a
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL threaded

Hossein, what's B Lotus font do you use in the DOCX? Could you share it?
Comment 9 Telesto 2022-09-04 15:22:31 UTC
I do repro this with
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: dc92a4d973086ce8a6a5f75ba0f4d4c9ca05537a
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded

It appears font / font substitution related
Comment 10 Hossein 2022-09-04 15:30:27 UTC
(In reply to Roman Kuznetsov from comment #8)
> no problem in
> 
> Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: dc92a4d973086ce8a6a5f75ba0f4d4c9ca05537a
> CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render:
> Skia/Raster; VCL: win
> Locale: ru-RU (ru_RU); UI: ru-RU
> Calc: CL threaded
> 
> Hossein, what's B Lotus font do you use in the DOCX? Could you share it?

It is strange! I would appreciate if you could attach the PDF output.

The font probably does not matter, because I also don't have this font installed. Installing it also did not help fix this problem.

Anyway, "B Lotus" font can be downloaded from here:

https://www.fontyab.com/wp-content/uploads/B-Lotus.zip
Comment 11 Hossein 2022-09-04 19:59:09 UTC
(In reply to Telesto from comment #9)
> I do repro this with
> Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: dc92a4d973086ce8a6a5f75ba0f4d4c9ca05537a
> CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
> Locale: nl-NL (nl_NL); UI: en-US
> Calc: CL threaded
> 
> It appears font / font substitution related

Could you please change the bug status to NEW?
Comment 12 Hossein 2022-09-04 20:00:56 UTC
bibisected using linux-64-7.3 to:

commit ce5f82dbaf1c22f45a08c60eb213bc9bc821c1d1
Author: Miklos Vajna <vmiklos@collabora.com>
Date:   Fri Jan 21 10:06:02 2022 +0100

    DOCX import: floating table with negative top margin has to be a fly frame
    
    The bugdoc has a large header, then part of the table goes into the
    whitespace of the header by specifying a negative vertical position.
    
    Keep this as a floating table as normal tables can't have negative top
    margins.


$ git bisect log
git bisect start
# bad: [a2e1034fba7391706e0a3541ac3ba844ee72fc63] source ff6e536111a966f465c4756cbfa74935752df612
git bisect bad a2e1034fba7391706e0a3541ac3ba844ee72fc63
# good: [10b48805b6e47b3ed961691ad63bebe1f3ee1eca] source ff2ba77f22b2e96f96f5537aec1705956b47583d
git bisect good 10b48805b6e47b3ed961691ad63bebe1f3ee1eca
# good: [fa60fd3c6878935269747b6d35a8bab5daea4b59] source 58418e9a85a007f550d9deb02729fc0c96cc1efd
git bisect good fa60fd3c6878935269747b6d35a8bab5daea4b59
# good: [4e8391efbcbfd9f2bcf19436c5e013ba4580e1fb] source 0e4496292f0d67709340879180393c573aeebf93
git bisect good 4e8391efbcbfd9f2bcf19436c5e013ba4580e1fb
# good: [8dc2700c91fe3e322751136cc6b3698f3cb02ede] source a7fb9ec83d08d28383918a40a0f9ccbbdccbf506
git bisect good 8dc2700c91fe3e322751136cc6b3698f3cb02ede
# bad: [e83e8ae8422bb7d50091a9f3672f9a5575bf768b] source cc86bc599c8b3ce786e05246e82559888817ab12
git bisect bad e83e8ae8422bb7d50091a9f3672f9a5575bf768b
# bad: [624ec635167622268daaacb1db1d68e28a82b946] source cc5583dd49377bcd8c019d11963ca170550466cc
git bisect bad 624ec635167622268daaacb1db1d68e28a82b946
# good: [4ca431e89e12bcdc663b8e24f4d30dcadd597f72] source 04df6bc4b49b0c42bcc4382fd0a5261370dbfa0e
git bisect good 4ca431e89e12bcdc663b8e24f4d30dcadd597f72
# bad: [760fd768e8b1105825d498cb978636293618ef0a] source 0453a2ff5d51181dd3036b10a4a2d2eeef7981be
git bisect bad 760fd768e8b1105825d498cb978636293618ef0a
# good: [37ad7a4309b37f17941960ba1151a9d5dcf1cd24] source 92fb148a956087483ac837dd540e555e777f1e53
git bisect good 37ad7a4309b37f17941960ba1151a9d5dcf1cd24
# bad: [6c2e703d43a4eb193e7c42014ecee6bf5876cfd0] source d243e9dbfb8497bed03601a04f168bc1832ce263
git bisect bad 6c2e703d43a4eb193e7c42014ecee6bf5876cfd0
# bad: [0cbce78e02706b1bf75ac4673c4867ca971ebde1] source 7c1ca3b3916b3216188cdb32852cb2058cf070f3
git bisect bad 0cbce78e02706b1bf75ac4673c4867ca971ebde1
# good: [d14316a05b6a5efc0d38d31aa9d32bd6aabeea3f] source 3b7f42c033478a4faec15baf92f6fa61cd09eba6
git bisect good d14316a05b6a5efc0d38d31aa9d32bd6aabeea3f
# good: [8b7e6e55e67e05e6ba40fc5d68e6b9ecd11c6ae4] source 9d39aba021434fbb07f7e362ecaab1c75d2ff5fc
git bisect good 8b7e6e55e67e05e6ba40fc5d68e6b9ecd11c6ae4
# bad: [accdbd1e0c72d46e4fe0fb50a8197f186358ba32] source ce5f82dbaf1c22f45a08c60eb213bc9bc821c1d1
git bisect bad accdbd1e0c72d46e4fe0fb50a8197f186358ba32
# first bad commit: [accdbd1e0c72d46e4fe0fb50a8197f186358ba32] source ce5f82dbaf1c22f45a08c60eb213bc9bc821c1d1
Comment 13 Hossein 2022-09-04 20:11:34 UTC
Created attachment 182213 [details]
Output from MS Word

On thing to add is that the table is RTL, but here it is rendered as LTR. Even in 7.2 and earlier, that I considered good. This is despite the fact that in the table and pages settings, one can see that both page and the table are set as RTL.

Please compare the LO output with the output from MS Word.
Comment 14 Miklos Vajna 2022-09-05 07:01:59 UTC
I think the root cause here is a missing feature: multi-page floating tables in Writer. See bug 61594 for more details. Adjusting keywords accordingly.
Comment 15 Stéphane Guillou (stragu) 2022-09-05 08:18:28 UTC
Also confirmed on:

Version: 7.3.5.2 / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Not confirmed with attachment 182194 [details] saved as ODT, so DOCX-specific.

Adding See Also and Meta bug
Comment 16 Hossein 2023-04-20 14:52:57 UTC
(In reply to Miklos Vajna from comment #14)
> I think the root cause here is a missing feature: multi-page floating tables
> in Writer. See bug 61594 for more details. Adjusting keywords accordingly.
Now that the above issue (tdf#61594) is fixed (thank you, Miklos!), I still see this problem.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ab5e812e381b85ddd8bc4a3456e9b7695f824c95
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded
Comment 17 Commit Notification 2023-05-31 07:04:33 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#150769 sw floattable: fix lost PageDescName if section starts with a table

It will be available in 7.6.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 Hossein 2023-05-31 08:32:40 UTC
Thank you Miklos!

Verified the fix with the latest LO 7.6 dev master:

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: e851d081c614107c450f8ac87e415b49a58bb5bf
CPU threads: 12; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded