https://bugs.documentfoundation.org/show_bug.cgi?id=172184

            Bug ID: 172184
           Summary: DOCX Footnotes and Endnotes from Word Online render
                    out of sequence / dissociated due to reliance on ID
                    number order rather than document flow
           Product: LibreOffice
           Version: 26.2.3.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
Classic mismatch in how Word handles footnote/endnote sequencing: Implicit ID
Sequencing vs. Explicit Relational Mapping. 

In DOCX documents, there is a distinct split between where a footnote is called
and where its text lives: 

    word/document.xml (The body text): Contains a pointer element that looks
like this: <w:footnoteReference w:id="5"/>. 

    word/footnotes.xml (The storage bank): Contains the actual text block
wrapped in an identical ID tag: <w:footnote w:id="5"><w:p><w:t>Actual footnote
text</w:t></w:p></w:footnote>. 

According to the official OOXML standard, the w:id is just a relational bridge.
The actual sequence or layout of the document is supposed to be dictated
entirely by the order in which the document.xml layout engine encounters those
references as it reads the text from top to bottom. 

It appears LibeOffice is assuming it can load the word/footnotes.xml and
word/endnotes.xml based on the numerical sequence of the Footnote ID and
Endnote ID and then place them based on the order footnotes and endnotes appear
in word/document.xml NOT matching IDs as they occur in word/document.xml with
the ID in word/footnotes.xml and word/endnotes.xml. 

This affects Word Online because it does not bother to re-squence Footnote ID
and Endnote ID to keep them in appearance order. 

Steps to Reproduce:
1. Create a multi-page document inside the Word Online web application. 
2. Insert several footnotes out of order (e.g., write page 3, add a footnote,
go back to page 1, add another footnote).  
3. Export/Save the file as a .docx. 
4. Open the document inside Microsoft Word or Word Online (it displays
correctly as numbers 1, 2, 3 based on text flow). 
5. Open the exact same .docx file in LibreOffice Writer.

(Alternatively, unzip any DOCX with footnotes or endnotse and modify the
corresponding IDs in word/document.xml with the ID in word/footnotes.xml and
word/endnotes.xml)

Actual Results:
The footnote/endnote numbers are scrambled out of sequence, display the wrong
references, or dissociate from their anchors entirely.

Expected Results:
The import filter should track footnote rendering strictly by traversing
<w:footnoteReference> positions in word/document.xml dynamically, resolving the
IDs against the database in word/footnotes.xml without regard to array position
or numerical ID values.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Compliance Reference to Open Standards:
According to the official ECMA-376 Standard (Office Open XML File Formats, 5th
Edition, December 2021, Part 1, Page 761), the w:id attribute on a <w:footnote>
or <w:endnote> tag is purely a relational map bridge.
https://ecma-international.org/publications-and-standards/standards/ecma-376/  

The standard explicitly defines the relationship: 

* The text flow inside word/document.xml dictates layout order via individual
<w:footnoteReference w:id="X"/> element tags encountered linearly from
top-to-bottom. 

* The id string attribute is explicitly a relational pointer intended to locate
data blocks inside the notes vault—it must not be utilized by the renderer to
imply sequence or physical document numbering. 

If Word Online re-sequenced Footnote ID and Endnote IDs by their appearance in
the document, even if they remained so sparse, this would not be an issue, but
according to the OOXML spec, Word Online is not required to re-sequence.

---
More:

LibreOffice Writer appears to parse and number notes sequentially based on
their literal physical index array order or ID values inside word/footnotes.xml
(and word/endnotes.xml). It assumes the id array sequence in the notes bank
dictates document order. 

This is a distinction without a difference when the Desktop version of Word
re-sequences footnotes and endnotes when new items are inserted (cut, copied
and pasted, etc). 

However, because Word Online splits document order from storage order,
LibreOffice disassociates the footnote numbering from its logical place in the
text.

---
Attached Supporting Evidence Files (to be added once bug is filed):

Footnotes: 

1. The Shield of Upper Canada-Footnotes example-Created in Word
Online-May19-2026.docx – The source document showing sparse, massive IDs. 
2. The Shield of Upper Canada-Footnotes example-Created in Word
Online-May19-2026-Exported from Word Online.pdf – Direct PDF export showing the
correct, specification-compliant sequential notes. 
3. The Shield of Upper Canada-Footnotes example-Created in Word
Online-May19-2026-Exported from LibreOffice.pdf – Direct PDF export showing the
scrambled text references and broken layout sequence. 
4. footnotes_analysis.csv - CSV mapping the physical XML array order against
the underlying Word Online generated Footnote IDs and document appearance order
to prove the structural mismatch 

Endnotes: 

1. The Shield of Upper Canada-Endnotes example-Created in Word
Online-May19-2026.docx – The source document showing sparse, massive IDs. 
2. The Shield of Upper Canada-Endnotes example-Created in Word
Online-May19-2026-Exported from Word Online.pdf – Direct PDF export showing the
correct, specification-compliant sequential notes. 
3. The Shield of Upper Canada-Endnotes example-Created in Word
Online-May19-2026-Exported from LibreOffice.pdf – Direct PDF export showing the
scrambled text references and broken layout sequence. 
4. endnotes_analysis.csv - CSV mapping the physical XML array order against the
underlying Word Online generated Footnote IDs to prove the structural mismatch 


P.S. This affects Chicago style the most, and no one associates Chicago with
corruption.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to