Bug 119011 - Variables defined in the same paragraph appear as a single cross-reference
Summary: Variables defined in the same paragraph appear as a single cross-reference
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: preBibisect, regression
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2018-07-30 23:10 UTC by Òscar
Modified: 2020-01-13 00:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice Writer. One cross-reference for two variables (28.30 KB, image/png)
2018-07-31 10:09 UTC, Roman Kuznetsov
Details
Example document (9.08 KB, application/vnd.oasis.opendocument.text)
2018-07-31 10:11 UTC, Roman Kuznetsov
Details
LibreOffice 3.3 (34.04 KB, image/png)
2018-08-02 15:23 UTC, Xisco Faulí
Details
Restart a variable and repeat the exact same context (18.46 KB, application/vnd.oasis.opendocument.text)
2019-05-18 11:51 UTC, Òscar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Òscar 2018-07-30 23:10:41 UTC
Description:
When a variable is defined twice in the same paragraph, a cross-reference to the first variable in that paragraph cannot be inserted because both variables appear as a single cross-reference in the cross-reference list.

Steps to Reproduce:
1. Open a new document and write "StepA ".
2. Create a new numbering sequence using a "number range variable" field: Go to Insert > Fields > Other, select the "Variables" page, select "Numebr range" in the "Type" list, select any type (for instance "A B C") in the "Format" list, write something (for instance "Step") in the "Name" field, and click "Insert". The letter "A" (number field) appears at the insertion point after "StepA ".
3. Press Enter and write "StepB ". Insert the variable field "Step" (select "Step" in the "Selection" list) again. The letter "B" appears after "StepB ".
4. Press Enter and write "StepC ". Insert the variable field "Step". The letter "C" appears after "StepC ".
5. Write ", step D ". Insert the variable field "Step". The letter "D" appears after "StepC C, step D ".
6. Press Enter and write "Repeat steps ". Insert the cross-reference "StepA A" to "numbering" (Go to Insert > Cross Reference, select "Step" in the "Type" list, select "Numbering" in the "Insert reference to" list, select "StepA A" in the "Selection" list, and click "Insert"). The number field "A" appears after "Repeat steps ".
7. Write " and ". Try to insert the cross-reference to "StepC C". In the "Selection" list appears the option "StepC C, stepD D". If this option is selected and isnerted, a "D" appears after "Repeat steps A and ".

Actual Results:
StepA A
StepB B
StepC C, stepD D
Repeat steps A and D

Expected Results:
StepA A
StepB B
StepC C, stepD D
Repeat steps A and C

[it should be possible to insert a cross-reference to both "StepC C" and "stepD D".]


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: ca-ES (de_DE); Calc: group
Comment 1 Roman Kuznetsov 2018-07-31 10:08:50 UTC
Confirm in 6.1.0.2. 
Now we have strange behavior for this case. 
There is only one cross-reference for two variables in one paragraph.
Comment 2 Roman Kuznetsov 2018-07-31 10:09:21 UTC
Created attachment 143837 [details]
LibreOffice Writer. One cross-reference for two variables
Comment 3 Roman Kuznetsov 2018-07-31 10:11:50 UTC
Created attachment 143838 [details]
Example document
Comment 4 Xisco Faulí 2018-08-02 15:22:27 UTC
Reproduced back to

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

However, its different in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 5 Xisco Faulí 2018-08-02 15:23:13 UTC
Created attachment 143935 [details]
LibreOffice 3.3
Comment 6 Òscar 2018-08-02 15:50:28 UTC
(In reply to Xisco Faulí from comment #4)
> Reproduced back to
> 
> Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
> 
> However, its different in
> 
> LibreOffice 3.3.0 
> OOO330m19 (Build:6)
> tag libreoffice-3.3.0.4

That make sense! I remember to have used this function without problems about 5 or 6 years ago.
Comment 7 Roman Kuznetsov 2018-08-02 16:06:38 UTC
I tried in LO 3.6.7.2. Same problem
Comment 8 Òscar 2019-01-20 11:33:16 UTC
Are there any updates here?
Is further information needed?
Comment 9 Òscar 2019-05-18 11:51:38 UTC
Created attachment 151494 [details]
Restart a variable and repeat the exact same context

There is another strange behaviour related to this bug. See the attached document for details.
Let's say you have two tables with footnotes. You use a variable to number the footnotes on each table with a letter (a, b, c,...). This variable is called "TableFootnote". When you insert the footnotes in the second table, you restart the variable, so it starts again with the letter "a". Let's say the first footnote is exactly the same in both tables:
"aUnits: g/mL"
Now try to insert a cross-reference to these footnotes (both letter "a"). You will see only one option displayed in the "Cross Reference" dialogue.
Only if you modify one of the footnotes (e.g. "aUnits: g/mL..."), then you can add a cross-reference to both footnotes.

Of course, a workaround would be to name the variables "Table1Footnote" for the first table, and "Table2Footnote" for the second table, but that's still not the desired behaviour.