Bug 101263 - Insert Cross-reference points to wrong footnote/endnote entry
Summary: Insert Cross-reference points to wrong footnote/endnote entry
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2016-08-02 19:16 UTC by jimrussell98116
Modified: 2023-02-13 10:44 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
test case for cross-reference bug (101263) (17.90 KB, application/vnd.oasis.opendocument.text)
2016-08-03 16:56 UTC, jimrussell98116
Details
.docx version of crossreference problem (6.11 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-08-03 16:57 UTC, jimrussell98116
Details
illustration of cross-reference problem with 5.1.4.2 release (15.56 KB, application/vnd.oasis.opendocument.text)
2016-08-03 17:25 UTC, jimrussell98116
Details
test of Bug 101263 (12.80 KB, application/vnd.oasis.opendocument.text)
2018-05-21 04:03 UTC, jimrussell98116
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jimrussell98116 2016-08-02 19:16:50 UTC
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36
Build Identifier: LibreOffice 4.4.7.2

Insert Cross-reference brings up a dialog box, opened to a tab "Cross-references". Picking Endnotes provides a list of existing endnotes to assign to the cross-reference. Picking one (in this instance #2) results in insertion of a number in the text where the cross-reference is made. The incorrect number is used (in this case #3), pointing the reader to the wrong endnote.

Reproducible: Always

Steps to Reproduce:
1.Insert Cross-reference
2.Choose Endnotes tab
3.Select an item from the list.
4. Number inserted in text is off by one.
Actual Results:  
Wrong number inserted.

Expected Results:  
Right number inserted.

[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Mac OS X (All)
OS is 64bit: no


Reset User Profile?No
Comment 1 Alex Thurgood 2016-08-03 07:49:34 UTC
@Jim : did you force an update of the fields ?
(in Tools → Options → LibreOffice Writer → General, Update, Fields)

What you are describing sounds like bug 76794, but it would be helpful if you could provide a sample document so that we could attempt to reproduce the situation.

Setting NEEDINFO status as a result. Please set back to UNCONFIRMED when you have provided the requested information (and test file).
Comment 2 jimrussell98116 2016-08-03 16:56:34 UTC
Created attachment 126548 [details]
test case for cross-reference bug (101263)

I tried to attach two alternatives, one in .docx format, the other in .odt, but I haven't figured out how through this interface.
Comment 3 jimrussell98116 2016-08-03 16:57:31 UTC
Created attachment 126549 [details]
.docx version of crossreference problem

Okay, here's the .docx version as well.
Comment 4 jimrussell98116 2016-08-03 17:00:37 UTC
For what it's worth, this may be related to the but you reference (76794), but it is not the same. 76794 refers to failure to renumber correctly. The problem I am reporting occurs on initial insertion of a cross-reference.
Comment 5 jimrussell98116 2016-08-03 17:25:11 UTC
Created attachment 126550 [details]
illustration of cross-reference problem with 5.1.4.2 release

Documentation that the problem persists in latest stable release.
Comment 6 Alex Thurgood 2016-08-04 11:40:54 UTC
Thansk Jim, will test and report back.
Comment 7 Alex Thurgood 2016-08-05 06:52:58 UTC
@Jim : from your last comment, am I correct in understanding that the problem initially occurs on a DOCX document ?

Does the ODT document you provided come from a DOCX document originally ?

I am trying to narrow down the problem to of :

- a filter issue when importing from / exporting to docx ; 

or

- a problem with cross-referencing that is directly linked to the internal representation of an ODT file in application memory.


My understanding at present is that you have started from a DOCX file, or that you save your file directly to DOCX rather than ODT. 


Setting back to NEEDINFO
Comment 8 Alex Thurgood 2016-08-05 07:19:30 UTC
Reproducible steps :

1) open a new Writer document.
2) Type a phrase and insert an endnote at the end of the line.
3) Press Enter (paragraph return).
4) Type another phrase and insert another endnote at the end of the line.
5) Press enter (paragraph return)
6) Type a third phrase and insert another endnote at the end of the line.
7) Press enter (paragraph return)

8) Note how the default numbering for these endnotes is roman numbering.

8) Type a fourth phrase and insert a cross-reference to endnote ii. A digit "2" is inserted at the selected point. Clicking on this digit takes you to endnote ii.

9) Type some more text and now insert a cross-reference to endnote i. A digit "2" is inserted at the selected point, but clicking on this digit takes you to endnote i.

10) Type some more text again and insert a cross-reference to endnote iii. A digit "2" is inserted at the selected point, and clicking on this digit takes you to endnote iii.


CONFIRMING
Comment 9 Alex Thurgood 2016-08-05 07:23:47 UTC
The question now is whether this is a regression, and if so, when did it previously work correctly.
Comment 10 Alex Thurgood 2016-08-05 07:33:27 UTC
@Jim : you can ignore my question, I managed to reproduce the problem for myself. Thanks for your input.

Note that there appeart to be a considerable number of bugs related to cross-referencing that have been around for a while, so this particular bug may not get resolved anytime soon.
Comment 11 QA Administrators 2018-05-18 02:33:11 UTC Comment hidden (obsolete)
Comment 12 jimrussell98116 2018-05-21 03:55:58 UTC
At your request, I tested the latest offered stable version (5.4.7.2) to see whether this has been fixed. No, the problem remains. I will try to attach my test document. It explores the problem a bit further. The test document was originally created in 5.4.7.2 as a .odt - it has never been a .docx.

Not sure what status to assign. Default is NEW, and it seems as good as any at this point.
Comment 13 jimrussell98116 2018-05-21 03:58:17 UTC Comment hidden (obsolete)
Comment 14 jimrussell98116 2018-05-21 04:00:33 UTC Comment hidden (obsolete)
Comment 15 jimrussell98116 2018-05-21 04:03:10 UTC
Created attachment 142221 [details]
test of Bug 101263
Comment 16 QA Administrators 2019-05-25 02:56:32 UTC Comment hidden (obsolete)
Comment 17 Timur 2021-09-29 14:25:44 UTC
Repro 7.3+. Seems Inherited.
I raise to Major because a LO component is not working right even in ODT, this is not some specific sample marked as "normal". 
Cannot be updated with F9 so bug 76794 only to See Also.
Comment 18 phv 2021-11-11 12:50:46 UTC
I cannot reproduce this issue in LibreOffice version 7.2.2.2. Yes, the documents in this report still contain numbering errors, but I cannot reproduce these by recreating the exact same documents:

- cross-references to endnotes and footnotes display the chosen numbering character.
- cross-references to endnotes and footnotes are displayed in the right numbering order.
- cross-references to endnotes and footnotes link to the correct endnotes and footnotes.

Am I missing something or is this issue more specific? I'm on Windows and I didn't import Microsoft Office documents with cross-references.
Comment 19 phv 2021-11-11 13:26:52 UTC
The only way to reproduce the faulty documents is to insert the endnotes and footnotes in the wrong order. Therefore, LibreOffice does not update the endnote and footnote lists automatically. This issue corresponds to bug #76794; so from my point of view, it is a duplicate issue.
Comment 20 Stéphane Guillou (stragu) 2023-02-13 10:44:55 UTC
What Jim and Alex describe here is the default behaviour of showing the page number for the endnotes (rather the endnote's number).
When adding an cross-reference, the default selection in the bottom-left is "page number (unstyled)". To use the endnote's numbering, one has to change it to "Referenced text".

See: https://help.libreoffice.org/7.6/en-US/text/swriter/01/04090002.html?System=UNIX&DbPAR=WRITER&HID=modules/swriter/ui/fldrefpage/FieldRefPage#bm_id3149042