Bug 121465 - Impossible to insert a cross reference to paragraph without the content of fields Before and After of the Customize tab of the list style, if field Before is used..
Summary: Impossible to insert a cross reference to paragraph without the content of fi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 117999 158840 (view as bug list)
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2018-11-16 15:22 UTC by estesprit-LO
Modified: 2024-01-30 10:48 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
Test case, as asked (10.67 KB, application/vnd.oasis.opendocument.text)
2018-11-18 19:41 UTC, estesprit-LO
Details
2nd Test case, first one was not accurate (11.76 KB, application/vnd.oasis.opendocument.text)
2018-11-19 10:45 UTC, estesprit-LO
Details
Outline of exact steps to reproduce the buggy behavior (13.75 KB, application/vnd.oasis.opendocument.text)
2020-08-12 18:33 UTC, Carl Hudkins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description estesprit-LO 2018-11-16 15:22:02 UTC
Description:
When inserting a paragraph numbering, with a custom style, I sometimes use separators to add meaning to the numbering like "Figure "+numbering+" - " or "Article "+numbering+" - ". Problem is, using a cross reference to these chapter numbers always include the separators, it is then impossible to use those x-refs in sentences like "look at articles 23 to 30".

Steps to Reproduce:
1. insert a paragraph numbering with pre or post separators
2. insert a reference to this numbers


Actual Results:
The separators are included with the numbering

Expected Results:
"number (without context)" should only show the numbering without the separators


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Oliver Brinzing 2018-11-18 17:41:09 UTC
Thank you for reporting the bug. 

Could you please add an example file?

I have set the bug's status to 'NEEDINFO'. 
Please change it back to 'UNCONFIRMED' once the requested info is provided.
Comment 2 estesprit-LO 2018-11-18 19:41:29 UTC
Created attachment 146726 [details]
Test case, as asked
Comment 3 estesprit-LO 2018-11-18 19:42:20 UTC
Test case added. Thanks for looking into it !
Comment 4 Dieter 2018-11-19 09:17:25 UTC
(In reply to edwsaintesprit from comment #3)
> Test case added. Thanks for looking into it !

Just choose chapter instead of number
Comment 5 estesprit-LO 2018-11-19 10:45:57 UTC
Created attachment 146766 [details]
2nd Test case, first one was not accurate

Sorry, the first test case was indeed not good enough to showcase my problem, as it could be worked around.
Comment 6 estesprit-LO 2018-11-19 10:50:08 UTC
Thanks Dieter for looking into it, and in the test case provided, your solution works, as the reference is also a chapter number. My mistake.

My problem refers to paragraph numbering, please see the new test case : my paragraph numbering is prefixed with "paragraph " and suffixed by ".".

This time, inserting a chapter is not a solution, as it would place the numbering of the chapter (here, "I") instead of a reference to the number of the article (here, "1"). Inserting a reference to the second paragraph would also show "I" (as it belongs to title 1) instead of "2" which is the number of the paragraph.
Comment 7 Dieter 2018-11-19 18:14:50 UTC
I confirm the bug with

Version: 6.2.0.0.beta1 (x64)
Build ID: d1b41307be3f8c19fe6f1938cf056e7ff1eb1d18
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (de_DE); UI-Language: en-GB
Calc: threaded

and

Version: 5.4.7.2 (x64)
Build-ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU-Threads: 4; BS: Windows 6.19; UI-Render: GL; 
Gebietsschema: de-DE (de_DE); Calc: CL

I can see no difference between
Number
Number (no context)
Comment 8 Oliver Brinzing 2018-11-20 18:10:52 UTC
(In reply to Dieter Praas from comment #7)
> I can see no difference between
> Number
> Number (no context)

with attached file: seems to be already reproducible with

AOO415m1(Build:9789)  -  Rev. 1817496
2017-12-11 17:25
Comment 9 estesprit-LO 2018-12-01 20:18:02 UTC
Looking at https://github.com/LibreOffice/core/blob/542d17d9384cced62db6bcfa45a5f44316409edc/sw/source/core/fields/reffld.cxx#L836,
it seems "context" here is not linked to separators but to the hierarchy of the referenced title.

If someone can confirm this, i'll mark this as "Not a Bug" and create a feature request to allow for numbers to be displayed without the separators.
Comment 10 Cor Nouws 2019-02-05 18:10:51 UTC
*** Bug 117999 has been marked as a duplicate of this bug. ***
Comment 11 lomacar 2019-03-10 11:06:23 UTC
This needs to be dealt with. I want to be able to cross-reference examples like (1a), but LO insists on doing it as (1)a, which is wrong. If we could insert the numbers/letters by themselves, then we could possibly get 1a, and then manually add the parentheses.
Comment 12 antoniak.piotr 2019-07-16 07:34:35 UTC
(In reply to Cor Nouws from comment #10)
> *** Bug 117999 has been marked as a duplicate of this bug. ***

How could it be a "duplicate" since #117999 was reported half a year earlier? ;)
Comment 13 Cor Nouws 2019-07-25 19:18:36 UTC
(In reply to antoniak.piotr from comment #12)
> How could it be a "duplicate" since #117999 was reported half a year
> earlier? ;)
In theory not, but for practical reasons, sometimes we do this ;)
Comment 14 Carl Hudkins 2020-08-12 18:31:59 UTC
I have just encountered this bug, and through investigation I determined that it is only the top-level items that force display of the "After" separator.  Second-level and deeper do not.

In my case, I was trying to have an outline structure such as:

Section 1. Blah
  1.A Blah
    1.A.1 Blah
    1.A.2 Blah
Section 2. Stuff...

For the top-level items in the outline, the word "Section" is in the "Before" separator, with a trailing space.

Elsewhere in the text, I want it to read "As mentioned in Section 2, blah..." but the reference will make it say "As mentioned in Section 2., blah..."

Note the unwanted period!

This behavior means I cannot have both the outline itself and the cross-reference look correct.  The fact that the reference appearance changes only if I put something in "Before" field makes it inconsistent, and therefore I consider it a bug.

I will attach a document showing exact steps to reproduce, and the unwanted behavior.
Comment 15 Carl Hudkins 2020-08-12 18:33:43 UTC
Created attachment 164220 [details]
Outline of exact steps to reproduce the buggy behavior
Comment 16 Carl Hudkins 2020-08-12 20:33:52 UTC
I need to retract part of my previous comment.  It's not only first-level items that exhibit this behavior.  In my situation, only the top-level outline item had anything in "Before" separator, so only that one displayed this behavior.  My test was flawed, because I only reproduced what I had been trying to get working.

Further testing shows that this happens no matter which outline level it is.
Comment 17 lomacar 2020-08-27 21:55:45 UTC
Still a problem in version 7. :(
Comment 18 Buovjaga 2024-01-30 10:48:01 UTC
*** Bug 158840 has been marked as a duplicate of this bug. ***