Bug 155815 - footnotes reordered with docx
Summary: footnotes reordered with docx
Status: RESOLVED DUPLICATE of bug 153804
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.5.1 release
Hardware: All Linux (All)
: medium normal
Assignee: László Németh
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: DOCX-Footnote-Endnote
  Show dependency treegraph
 
Reported: 2023-06-13 12:40 UTC by martyhiatt
Modified: 2023-07-07 10:04 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test file footnotes disappear when saved as docx (20.39 KB, application/vnd.oasis.opendocument.text)
2023-06-19 11:24 UTC, martyhiatt
Details
DOCX created from bugdoc with LibO4472. Empty footnotes with Master fine with 4472 (8.83 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-06-19 14:17 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description martyhiatt 2023-06-13 12:40:36 UTC
Description:
Possibly related to Bug 152526 and Bug 152203.

If I open a docx file with footnotes, make some changes to the text but not the footnotes, save (as docx or odt) and reopen the file, the footnotes (contents only) are out of order.

in my file, the first note remains the same, then 2,3,4 disappear so that 2 now contains the content of 5, 3 contains 6 and so on. then at the end, there are three more footnotes to be filled. they're not filled with 2,3,4, but with the contents of 5,6,7, such that those notes appear twice.

to try to reproduce the bug a second time, i started with the original file again. i opened, saved, opened again, and all is well.

but if i open it, and carefully replace the text surrounding the footnotes of the first few pages with other text (in this case, the same text translated), without touching the footnotes (anchors or content) themselves at all. then save and re-open, i get the bug. 

i tried again, pasting one block of text at a time, then saving and re-opening. when i pasted up to the first footnote, all is well (fn 1 was no problem). if i paste up until footnote 2, save, and re-open, footnote 2 only is incorrect: it has the contents of footnote 5. footnote 3 has not changed at all, nor have the others.

i also tried removing the styles of the text body and footnotes, to no effect. but i still feel like they may be involved.

i'm unable to provide the file as it is for a client, though i could possibly supply a file with all text removed (with styles, etc.) if that would help.

i'm also happy to provide further information if helpful.


Actual Results:
see above.

Expected Results:
see above.


Reproducible: Sometimes


User Profile Reset: No

Additional Info:
Version: 7.4.5.1 / LibreOffice Community
Build ID: 40(Build:1)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-GB (en_US.UTF-8); UI: en-US
Debian package version: 4:7.4.5-3~bpo11+1
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-06-13 12:53:07 UTC
Thank you for the report

Further DOCX footnotes issues have been fixed in later releases (e.g. bug 152506 and bug 153255). Can you please test 7.4.7 or 7.5.4 and let us know if you can still reproduce the issue?

Thank you.
Comment 2 martyhiatt 2023-06-13 13:19:57 UTC
ah, apologies, i hadn't managed to find those other reports. i'm unable to test right away. if i update to debian bookworm, i will only be able to test 7.4.5. but we can leave this for now i suppose. thank you for your reply.
Comment 3 martyhiatt 2023-06-13 13:26:40 UTC
ah i can try the deb install direct from libreoffice.
Comment 4 martyhiatt 2023-06-13 13:42:35 UTC
on 7.5.4.2:

if i open one of my existing files, that was previously displaying as reordered: if a docx file, all footnotes lose all their contents, if odt file: it displays correctly.

if i take my original, correct, file, and paste text into it as i was doing before to test, i now see a different issue: as i paste up until a given footnote (2, 3, etc.), save and re-open, the footnote pasted up to now contains the content of footnote 1 (so e.g. the same content is now in 1, 2 and 3.

seeing as i'm able to obtain a correct odt file, is there a possible way to obtain a correct docx from it? i need to forward it to someone else. perhaps it would be best to open in word and save from there?
Comment 5 martyhiatt 2023-06-13 13:47:03 UTC
i just tried opening a docx file with badly my ordered footnotes in microsoft word online. the footnotes there appear in the correct order. is it then only a matter of rendering, and my files should likely be fine?
Comment 6 Stéphane Guillou (stragu) 2023-06-13 20:23:10 UTC
(In reply to martyhiatt from comment #5)
> i just tried opening a docx file with badly my ordered footnotes in
> microsoft word online. the footnotes there appear in the correct order. is
> it then only a matter of rendering, and my files should likely be fine?

Hopefully that's the case, but hard to say without a test file.
Could you please prepare a sample document that displays the issue when compared  between MS Office and LO 7.5.4.2, and attach that file to this report?
It sounds like it could be a follow up to issues mentioned above.

Copying László Németh in, who has worked on that part of the software recently.
Comment 7 martyhiatt 2023-06-19 11:24:13 UTC
Created attachment 187989 [details]
test file footnotes disappear when saved as docx
Comment 8 martyhiatt 2023-06-19 11:24:56 UTC
i had some trouble preparing the document, but i hope it's helpful. when i remove the content of my document (i'm unable to share it for confidentiality reasons), the issue does not occur. though it does if i do not cut text.

when cutting the text, i tried not cutting a word either side of the footnote, but this also didn't work.

if i remove all comments, the issue disappears, yet if i then re-add another comment it does not reappear.

but the nonsense text does appear to reproduce the issue as requested:

open/close/open as odt, no problems. save to docx, close and re-open docx, footnotes vanish.
Comment 9 martyhiatt 2023-06-19 11:36:59 UTC
& the footnotes do appear if a saved .docx verison is opened with ms 365.
Comment 10 Telesto 2023-06-19 14:17:46 UTC
Created attachment 187997 [details]
DOCX created from bugdoc with LibO4472. Empty footnotes with Master fine with 4472
Comment 11 Telesto 2023-06-19 14:20:31 UTC
(In reply to Telesto from comment #10)
> Created attachment 187997 [details]
> DOCX created from bugdoc with LibO4472. Empty footnotes with Master fine
> with 4472

Still OK with
Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 229123ccc6f90ebf66b3e659bebbd53f8a9bdd3a
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
Comment 12 László Németh 2023-07-07 10:04:27 UTC
Fixed in Bug 153804 (and https://gerrit.libreoffice.org/c/core/+/154147).

@Martyhiatt & all: many thanks for the bug report and checking the issue!

*** This bug has been marked as a duplicate of bug 153804 ***