Bug 123027 - FOOTNOTE SETTING DIALOG: Changing character style of footnote area has no effect
Summary: FOOTNOTE SETTING DIALOG: Changing character style of footnote area has no effect
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 127254 139715 (view as bug list)
Depends on:
Blocks: Footnote-Endnote-Properties
  Show dependency treegraph
 
Reported: 2019-01-29 00:25 UTC by Daniele
Modified: 2023-10-13 12:34 UTC (History)
5 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 Daniele 2019-01-29 00:25:24 UTC
Description:
I have found that now Writer does not let me change the footnote style in the footer from character to anchor. When I select that (unfortunately at my University, the footnote numbers must be in superscript) and I press OK, nothing happens and it stays the same. I have found a "temporary" workaround in setting for the footnote in the footer to set it as endnote anchor and boom the number is in superscript. However, when I do insert a new footnote, all the footnotes numbers goes back to "character" style. Therefore, the only way to make it work is to ignore it, finish the document, then use the workaround method and do not touch the document and just save it. 

Using LibreOffice 6.1.4.2 on Mac OSX High Sierra 10.14.3

Steps to Reproduce:
1.Insert footnote
2. Go to Tools, footnotes and endnotes, in styles change the footnote area to anchor
3.Insert a new footnote

Actual Results:
Nothing happen

Expected Results:
Should change te footnote area number into superscript


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Comment 1 Telesto 2019-01-29 16:19:16 UTC
Repro with
Version: 6.3.0.0.alpha0+
Build ID: 6740443311268b7d918bf4f43134d64fb78a0109
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-01-15_23:37:04
Locale: nl-NL (nl_NL); UI-Language: en-US
Calc: CL

but not with
Versie: 4.4.7.2 
Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Locale: nl_NL
Comment 2 eisa01 2019-08-31 12:53:39 UTC
Reported on macOS, but confirmed on Windows, so setting OS to all
Comment 3 Dieter 2019-09-03 17:36:59 UTC
Still present in

Version: 6.4.0.0.alpha0+ (x64)
Build ID: 01837a85004a6f891a09c0a63ed7eff75d634827
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-01_00:07:05
Locale: en-GB (de_DE); UI-Language: en-US
Calc: threaded
Comment 4 Dieter 2019-09-03 17:38:12 UTC
*** Bug 127254 has been marked as a duplicate of this bug. ***
Comment 5 Mike Kaganski 2019-09-03 18:56:17 UTC
(From bug 127254 comment #3)
> That was changed in
> https://git.libreoffice.org/core/+/e9bf0102783e23cf8b7c609a9a5265ab436dc90e
Comment 6 Mike Kaganski 2019-09-03 18:57:51 UTC
(From bug 127254 comment #2)
> "Footnote Anchor" and "Footnote Characters" are two *character styles* that
> define the appearance of the relevant symbols. In fact, it is *not* expected
> that you would need that dialog to modify what you need; instead, it is
> expected that you open Styles (F11), go to Character styles ("A" button
> there), right-click "Footnote Characters" and choose "Modify...", and make
> necessary adjustments (e.g., on the Position tab - set Superscript).
> 
> I don't know why it was disabled to select the same character style for both
> numbers in anchors and footnote area
Comment 7 raal 2019-09-04 15:47:43 UTC
(In reply to Mike Kaganski from comment #5)
> (From bug 127254 comment #3)
> > That was changed in
> > https://git.libreoffice.org/core/+/e9bf0102783e23cf8b7c609a9a5265ab436dc90e

Adding cc to Bjoern
Comment 8 Justin L 2021-03-20 04:44:36 UTC
/me wonders why not just modify the Footnote Characters style and change the position to superscript?

Also, a custom style or any of the other styles work as a substitute. So it seems there are lots of work-arounds.

I can confirm Mike's bibisect - but not by using bibisect because any Linux dialog is crashing on OK shortly before that (using bibisect-linux-x64-6.2.

The problem seems to be in here:
            else if(pDocFormat->GetPoolFormatId() == nId)
                pDocFormat->SetPoolFormatId(0);

The order of preference (based on ID numbers) is 
Footnote Characters (1024)
Footnote Anchor (1037)
Endnote Characters (1034)
Endnote Anchors (1038)

Since Endnote Characters is the third in the list, it will accept to change to Footnote Characters, or Footnote anchor, but not Endnote anchor. So Endnote Anchors can be changed to any of the existing markers, but Footnote Characters cannot be changed to anything else.

I haven't figured out exactly why that is. I also notice that the list of pDoc->GetCharFormats() grows each time, so a memory leak is included in the list of problems here.
Comment 9 Justin L 2021-03-20 15:13:47 UTC
It is a bit more complicated than I first stated. Even though some of the footnote settings may share the same style name, they aren't actually sharing the same underlying style. So changes to the footnote anchor style are only going to affect the real anchor - even if both text and anchor seem to be set to the "Footnote Anchor" character style. (In this case, it doesn't find a matching entry for "Footnote Character"(1024), and so it re-creates a default 1024, but with the name "Footnote Anchor". So there are now two "Footnote Anchor" styles with different IDs.)

So the best solution is probably to remove the styles that are currently in use from the list to choose from - so that a unique style must exist in those four locations. (That is easier said than done.)
Attempted at https://gerrit.libreoffice.org/c/core/+/112814
Comment 10 Justin L 2021-11-25 09:36:10 UTC
*** Bug 139715 has been marked as a duplicate of this bug. ***
Comment 11 Telesto 2022-07-03 03:47:30 UTC Comment hidden (obsolete)