Bug 152203 - Footnotes randomized on DOCX import
Summary: Footnotes randomized on DOCX import
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0 target:7.5.0.0.beta2 tar...
Keywords: bibisected, bisected, filter:docx, regression
: 152526 (view as bug list)
Depends on:
Blocks: DOCX-Footnote-Endnote
  Show dependency treegraph
 
Reported: 2022-11-24 14:44 UTC by Ivan Voras
Modified: 2023-01-27 23:34 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Footnote test document (824.89 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-11-24 14:47 UTC, Ivan Voras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Voras 2022-11-24 14:44:16 UTC
Description:
Footnotes are shown in LibreOffice Writer in the wrong order, in a document exported from Google Docs as DOCX.

It looks like they are imported in the order in which they are written, not in which they should be displayed. I.e. if footnotes are written out of order, the import process will put the content of the Nth footnote written in the Nth footnote location in the document, and not with the correct foothold number (which could be anywhere in the document). See the attached example.

Steps to Reproduce:
1. Save this Google doc as DOCX, observe how footnotes are arranged: https://docs.google.com/document/d/1bchredyAFKA3klaW-8dkrBRh3Xvdxqbv5ADZ6FEpCyw/edit?usp=sharing
2. Open the document in LibreOffice Writer, see how the last 2 pages have swapped footnotes.

I will try to attach the docx also.

Actual Results:
Each page has its own specific footnotes

Expected Results:
Last 2 footnotes are swapped


Reproducible: Always


User Profile Reset: No

Additional Info:
Discovered this on 100+ pages long document, where the footnotes are completely randomized when loaded in LibreOffice Writer.
Comment 1 Ivan Voras 2022-11-24 14:47:01 UTC
Created attachment 183756 [details]
Footnote test document

When this doc is opened in Word, footnotes are in the correct order.
When opened in LibreOffice Writer, the footnotes for the last 2 pages have swapped places.
Footnote *numbers* are ok, footnote *content* isn't.
Comment 2 Stéphane Guillou (stragu) 2022-11-24 15:52:13 UTC
Reproduced with the Google Docs downloaded as DOCX in a master build from today. Downloaded ODT does not have that issue.

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c130063895c7a733ad121db1bf5fbceac38f6ad5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (en_AU.UTF-8); UI: en-US
Calc: threaded

But not in:

Version: 7.1.8.1 / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 3 Stéphane Guillou (stragu) 2022-11-24 16:13:51 UTC
Bisected to:
 93d819a322e6351c4474db0f481fc8d939973bf9 is the first bad commit
commit 93d819a322e6351c4474db0f481fc8d939973bf9
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Fri Feb 12 18:33:12 2021 +0100

    source 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357

 instdir/program/libwriterfilterlo.so | Bin 3172608 -> 3181032 bytes
 instdir/program/setuprc              |   2 +-
 instdir/program/versionrc            |   2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

Which points to:

commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357
author	László Németh <nemeth@numbertext.org>	Wed Feb 10 00:12:52 2021 +0100
committer	László Németh <nemeth@numbertext.org>	Fri Feb 12 18:27:31 2021 +0100
tree f1bb0d9c24dbe6a40e82837f0ff5632a90799530
parent 3380163bc0fb9dab7f289cc36b0eeb0c9b3ddaa9

tdf#76260 DOCX import: fix slow footnote import

László, could you please have a look?
Comment 4 László Németh 2022-11-30 00:20:39 UTC
@Ivan, Stéphane: thanks for the report and its forwarding!
Comment 5 Commit Notification 2022-12-10 18:29:23 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/09ae3c01940bbc25ffde51963683b04e3cb4bb6a

tdf#152203 DOCX import: fix mixed footnotes/endnotes

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 6 László Németh 2022-12-11 13:20:43 UTC
@Ivan, Stéphane: thanks for reporting and QA!
Comment 7 Commit Notification 2022-12-12 13:28:51 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/78ae28707022a014baf8c477b6c3f8ff91052803

tdf#152203 DOCX import: fix mixed footnotes/endnotes

It will be available in 7.5.0.0.beta2.

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 Stéphane Guillou (stragu) 2022-12-13 18:58:03 UTC
Fix verified in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 01c9c971e43782800ebf63acc763a7e7fba096c1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thank you László! :)
Comment 9 Commit Notification 2022-12-14 08:42:52 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/8e86044aab54c47773b5db2316e58586a4e865a0

tdf#152203 DOCX import: fix mixed footnotes/endnotes

It will be available in 7.4.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.
Comment 10 László Németh 2022-12-14 09:31:51 UTC
(In reply to Stéphane Guillou (stragu) from comment #8)
> Fix verified in:
> 
> Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 01c9c971e43782800ebf63acc763a7e7fba096c1
> CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> Calc: threaded
> 
> Thank you László! :)

@Stéphane: thanks for the verification and your feedback! :)
Comment 11 Stéphane Guillou (stragu) 2022-12-15 18:41:33 UTC
*** Bug 152526 has been marked as a duplicate of this bug. ***