Bug 155418 - EDITING: Regression: Insert - Cross-reference, Set Reference duplicates the selected text
Summary: EDITING: Regression: Insert - Cross-reference, Set Reference duplicates the s...
Status: RESOLVED DUPLICATE of bug 157394
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha1+
Hardware: All All
: medium minor
Assignee: Not Assigned
URL: https://git.libreoffice.org/core/comm...
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2023-05-20 07:04 UTC by Matti Tyrväinen
Modified: 2023-10-13 15:19 UTC (History)
8 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 Matti Tyrväinen 2023-05-20 07:04:26 UTC
Description:
Commit https://git.libreoffice.org/core/commit/384a80fc56e75e3d1ee18ffc303db85490716829 changed reference mark behavior and thus was bound to break code dependent on the old behavior.

One such instance seems to be Insert - Cross-reference -> Set Reference which now duplicates the text selected to become a reference marker.

Steps to Reproduce:
1. type 'foo'
2. press Ctrl-a to select 'foo'
3. Insert - Cross-reference, Set Reference, Name: bar, Insert, Close

Actual Results:
The document now has the text "foo" followed by the cross-reference "foo" ("foofoo"), with the cursor between the "foo"s. No text is selected.

Expected Results:
Previously these steps would result in a single cross-reference "foo" that was selected.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
I'd consider this regression a less-severe bug than 81720, as this one (1) doesn't affect reference manager users, (2) can be easily worked around by erasing the extra text after using Set Reference, and (3) 81720 also affected the workflows using Set Reference.
Comment 1 m_a_riosv 2023-05-20 22:44:58 UTC
I think the issue, it's when creating the insert it's to insert in the list of cross-references, not to insert it in the text.

https://help.libreoffice.org/latest/en-US/text/swriter/guide/references.html?DbPAR=WRITER#bm_id3145087
Comment 2 Matti Tyrväinen 2023-05-21 11:06:10 UTC
(In reply to m.a.riosv from comment #1)
> I think the issue, it's when creating the insert it's to insert in the list
> of cross-references, not to insert it in the text.
> 
> https://help.libreoffice.org/latest/en-US/text/swriter/guide/references.
> html?DbPAR=WRITER#bm_id3145087

Indeed, this bug concerns the creation of a cross-reference "Target"; inserting a (cross-)reference via "Insert - Cross-reference, Type: Insert Reference, Refer using: Referenced text" works as it should as far as I'm aware. Thanks for the clarification!
Comment 3 m_a_riosv 2023-09-30 01:29:57 UTC
*** Bug 157489 has been marked as a duplicate of this bug. ***
Comment 4 Buovjaga 2023-10-03 15:42:48 UTC
*** Bug 157364 has been marked as a duplicate of this bug. ***
Comment 5 Buovjaga 2023-10-06 13:03:35 UTC
Blamed commit seemed to not be guilty after all or at least this was solved in bug 157394.

*** This bug has been marked as a duplicate of bug 157394 ***
Comment 6 thdeppner 2023-10-06 13:35:28 UTC
> My apologies, I wasn't aware of this use case! Could you please add complete
> steps to reproduce for "referencing table cells that contain a formula" to
> bug 155418? Calculating "intable" seems to work on 7.6.0.3 - I'm guessing
> you're doing something else that involves cross-references inside the table?

Sure:
1. Create a table containing 1 row and 3 cells.
2. Enter the value "1" into cells A1 and A2.
3. Enter the formula "=<A1:A2>" into cell A3; cell A3 should now display the value "2".
4. Mark the value "2" in cell A3 and try to set a reference to it.

This used to work, now you get a second "2" added to the cell and the formula is gone.

The reference is useful if you want to reference to the value of the table cell in the text (not: in the cell of the table or even another table; this works without reference by adressing the cell via [tablename].[cell]).

In my case I use the table to calculate a sum for an invoice which I reference in the text ("Please pay [reference to calculated amount]...")
Comment 7 Matti Tyrväinen 2023-10-07 06:15:08 UTC Comment hidden (obsolete)