Bug 167750 - FILEOPEN round-tripped DOCX: footnote characters are large, not superscript (limited time-frame for round-trip)
Summary: FILEOPEN round-tripped DOCX: footnote characters are large, not superscript (...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.1 rc
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Footnote-Endnote
  Show dependency treegraph
 
Reported: 2025-07-31 20:03 UTC by Justin L
Modified: 2025-08-14 16:13 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-07-31 20:03:37 UTC
Starting in 25.2.0, the footnote numbering in (at least some) docx files is big - like LO defaults, not a smaller superscript - like MS Word defaults to.

This (re)started with 25.8 commit 44878a26e0d934a80ab39d5bf597ca49e46db86e
Author: Michael Stahl on Mon Dec 9 15:53:40 2024 +0100
    tdf#159549 sw: fix style mapping for Character Styles
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178172

I noticed that when I placed the cursor after the footnote, the assigned character style is no longer "Footnote Characters",
it is "Footnote Characters (user)".

I looked in Tools - Footnote/Endnote settings and see "Anchor in Footnote = Footnote Characters". If I change this to "Footnote Characters (user)" then I get the expected look.

AFAICS, this doesn't happen with documents created by MS Word. It seems to only happen after LO round-trips the file (and thus introduces that style name).

Example documents:
-footnote-w-lo6_v2.docx (attachment 138046 [details] from bug113553)
-17pages-with-footnoteref-modified.docx (attachment 143120 [details] from bug 118385)
-footnote3_export.docx (attachment 146660 [details] from bug 121441) [not a clear example]
Comment 1 Justin L 2025-08-13 01:31:08 UTC
This patch seems to fix it, but I don't know why.
https://gerrit.libreoffice.org/c/core/+/189463

Prior to LO 6.0 commit 707eb4db1918658e0c2c2c2033c6a69f80c4eafd
Author: Justin Luth on Sat Jun 3 10:02:20 2017 +0300
    tdf#82173 writerfilter: charStyle XnoteReference->Xnote Characters
Word's "footnote reference" mapped to LO "Footnote anchor"
Comment 2 Justin L 2025-08-14 16:13:38 UTC
In the three provided examples in comment 0, none contains the special MSWord "footnote reference" style - so no special handling is envoked to ensure LO's magical ProgName"Footnote Symbol" English-UIName"Footnote Characters" style is set to superscript on import.

So for simple import, these examples are somewhat irrelevant.

P.S. master is creating the "footnote reference" style again, so this particular aspect of the problem shouldn't be occurring any more.

However, multiple round-trips in master still show erratic results. 

The problem comes when sConvertedStyleName = "Footnote Characters (user)". FillUIName drops the (user), and then xStyles->hasByName returns true - it matches ProgName"Footnote Symbol". So here we have the big problem. "Footnote Characters" doesn't map to "Footnote Symbol", but "Footnote Characters (user)" does. Yikes. (I expect the same concept in true in other languages.)

So if I got this right, then I would expect the properties of <builtin-in> and <build-in (user)> to flipflop on each round-trip.  (But footnote/endnote are not good testcases for this, because of special code that copies Symbol -> anchor).

This whole area seems to still be a complete disaster, but I'm downgrading this to low priority because I can't create something from scratch that clearly shows a problem, and even these documents tend to work themselves out after 3 round-trips.