Bug 144717 - ENDNOTES: I can't change endnote anchor to footnote anchor, if a table follows
Summary: ENDNOTES: I can't change endnote anchor to footnote anchor, if a table follows
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Footnote-Endnote
  Show dependency treegraph
 
Reported: 2021-09-25 12:14 UTC by John
Modified: 2024-11-11 17:26 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
endnotes (33.89 KB, image/png)
2021-09-25 12:14 UTC, John
Details
test ODT (11.66 KB, application/vnd.oasis.opendocument.text)
2022-01-11 12:07 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John 2021-09-25 12:14:26 UTC
Description:
Three issues related to converting endnotes to footnotes. And probably vise versa.

Here we go:

1. Type "foo"
2. Insert an endnote "bar"
3. Return to "foo"

3. To convert "bar" to footnote, select its anchor (that is, lowercase i after "foo"), open the context menu, select "Footnote or Endnote", and then select "Footnote" under "Type".

3.1. And here we have the first issue. I expect that instead of using the context menu, I can use the menu bar: Select lowercase i after "foo" > "Insert" > "Footnote and Endnote" > "Footnote or Endnote" > Select "Footnote" under "Type". But this will create a new (blank) footnote instead of converting "bar" from endnote to footnote.

4. Create a table, type "aaa" in it, insert endnote "bbb" after it, select its anchor, and open its context menu.

4.1. And here we have the second issue. There is no "Footnote or Endnote" item in context menu, so you need to put "aaa" out of table, convert the endnote to footnote, and then place "aaa" in table again.

5. And the third issue is that in one of my documents the solution from 4.1 doesn't work. When I put "aaa" out of table, select ii anchor after it, open its context menu, select "Footnote or Endnote", and then select "Footnote" under "Type", it selects the whole table (yeah, "aaa" it out of table of this mome)

And now the 3rd issue, the worst.

Creat two tables with 3 columns and 2 rows each, seperated by the empty line.

Type "aaa" and insert endnote "foo" in the first cell of the 1st table.
Type "bbb" and insert endnote "bar" in the first cell of the 2nd table.

Now put "aaa" out of its table to change its endnote to footnote. Select the anchor, open its context menu, select "Footnote or Endnote". And now the window "Edit Footnote/Endnote" has opened and you can select "Footnote" under "Type". Right? Not so far! As you probably see, Writer selected everything below the first anchor. See the attached image. And if you select "Footnote", nothing will happen. Converting won't work. You will need to put your "aaa" into **another document** to fix this.

Steps to Reproduce:
see above

Actual Results:
see above

Expected Results:
see above


Reproducible: Always


User Profile Reset: No



Additional Info:
see above
Comment 1 John 2021-09-25 12:14:58 UTC
Created attachment 175264 [details]
endnotes
Comment 2 John 2021-09-29 08:06:55 UTC
I just realized that to change endnote to footnote (or vice versa), after I have selected it, I should probably use "Edit > Reference > Footnote or Endnote", and not "Insert > Footnote and Endnote > Footnote or Endnote".

This explains why the first issue exists.

But this doesn't explain/justify/fix the second and the third issues.

Also, if I am right and windows
* "Edit > Reference > Footnote or Endnote"
* "Insert > Footnote and Endnote > Footnote or Endnote"
work differently, it may be a good idea to make them **look** differently as well.
Comment 3 Dieter 2021-10-14 13:11:21 UTC
(In reply to John from comment #2)
> Also, if I am right and windows
> * "Edit > Reference > Footnote or Endnote"
> * "Insert > Footnote and Endnote > Footnote or Endnote"
> work differently, it may be a good idea to make them **look** differently as
> well.

The first dialog is named "Edit Footnote/Endnote" and the second is named "Insert Footnote/Endnote". So personally I think, that difference is clear.
Comment 4 Dieter 2021-10-14 13:21:01 UTC
First issue is obsolete. But I can confirm second and third issue with

Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

But since there is the basic rule "One issue / one bug report" we should focus on third issue (because you call it the worst). I changed bug summary to that. Please open new report for second problem.

Steps to reproduce

1. Open an new document.
2. Write at least one word and add endnote
3. Add a table, insert some text in first cell and add an endnote to that text
4. Select first endnote.
5. Open "Edit Footnote/Endnote - Dialog" (with context menu or with Edit => Reference => Footnote or Endnote

Actual result:
Table is also selected and it's impossible to change endnote into footnote

Expected result:
Only endnote anchor is selected
Comment 5 Timur 2022-01-11 11:42:40 UTC
No repro LO 4.2.0 Repro 4.2.8 and 7.4+. Regression.
Comment 6 Timur 2022-01-11 12:07:30 UTC
Linux-43max
commit 52b45843f08974fe8a8995fa12619ceb30998626
Date:   Thu May 28 17:39:12 2015 +0800
   source-hash-3fc6fc2ff7304a0d1bc85bd2e03fb3fbab492c9a
   prev source-hash-f6f2ee5bdd9e0d44437bfbd6dd338adea956b2ab

author	Oliver-Rainer Wittmann <orw@apache.org>	2013-12-10 
committer	Caolán McNamara <caolanm@redhat.com>	2013-12-10
commit 3fc6fc2ff7304a0d1bc85bd2e03fb3fbab492c9a (patch)
Related: #i33737# correction: assure the selections does not...
start/end inside a table while end/start of the selection is outside the table
(cherry picked from commit 382814ccb30bfe71f093e55e23802447caca235d)

So, bibisect is here, but no dev, we should get one.
Comment 7 Timur 2022-01-11 12:07:55 UTC
Created attachment 177457 [details]
test ODT
Comment 8 QA Administrators 2024-01-12 03:13:11 UTC Comment hidden (obsolete)
Comment 9 Dieter 2024-05-04 09:33:09 UTC
Still present in

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7c2ed9919d6d9d286d9062b91577d6bb2b7de8aa
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

Steps:
1. Open attachment 175264 [details]
2. Select Endnote numer in first paragraph and try to change it to footnote with Edit -> Reference -> Footnote endnote

Actual result
Doesn't work, because table is always selected, too.

Additional information
3. Enter a third endnote outside table
4. Delete table
5. Repeat stept 2 (Works)
Comment 10 Mike Kaganski 2024-11-11 06:21:30 UTC
The important things (missing e.g. in comment 4):

1. The end-of-paragraph and table must immediately follow the endnote anchor.
2. The "select first endnote" means "select over the anchor from right to left": because selecting from left to right disallows the "Edit => Reference => Footnote or Endnote", and avoiding the selection at all by putting the cursor *before* the anchor works fine.
Comment 11 Mike Kaganski 2024-11-11 11:49:10 UTC
https://gerrit.libreoffice.org/c/core/+/176399
Comment 12 Mike Kaganski 2024-11-11 11:49:49 UTC
(In reply to Mike Kaganski from comment #10)
> 1. The end-of-paragraph and table must immediately follow the endnote anchor.

This was wrong.
Comment 13 Commit Notification 2024-11-11 17:26:11 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a9ac0a7f6c8475d97480318ebd1fe35e964a8600

tdf#144717: fix SwInsFootNoteDlg's next/prev button state check

It will be available in 25.2.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.