This happened when another person reviewed a document I had written, and said all figures had lost their reference type.
When I created the document in LibreOffice Writer with English user interface, I had to create a 'custom' number range because the document was in Portuguese, and I had many figures - so, a number range "Figura" and many cross references to "Figura". Those cross references use the type "Category and Number" to show, say, "Figura 1".
At the review, the person reported that "Figura 1" was actually showing just "1". I reopened the file in my computer, and everything was normal.
So, I tried switching LO user interface to Portuguese, just to see if that happened. Bingo - no "Figura 1", just "1". I even tried fixing it, modifying every field in the document, changing any "Illustration" range to "Figura", but the problem persists if the document is opened in another user interface language.
Steps to Reproduce:
0. LibreOffice user interface in, e.g., English (USA)
1. New document (or any document with built-in number ranges);
2. Insert caption - use any built-in number range (e.g. "Illustration");
3. Insert cross-reference to captioned item, using style "Category and Number" (located in "Insert Reference to" dropdown);
5. Change LibreOffice user interface (e.g. Portuguese - Brazilian);
6. Open document saved in step 4;
7. Press space in front of that reference.
Although the document looks fine when you open it, after you modify anything in it, the cross-reference category disappears. If there where any other cross-ref to other built-in styles, all of then disappear.
No change in cross-references.
User Profile Reset: No
Built-in style "Figure" doesn't seen to be affected by this bug on version 220.127.116.11 - it is affected in version 18.104.22.168.
Tested in (portable version):
Build ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU threads: 4; OS: Windows 6.2; UI render: GL;
Locale: pt-BR (pt_BR); Calc: group
First noticed in (installed version):
Version: 22.214.171.124 (x64)
Build ID: 5896ab1714085361c45cf540f76f60673dd96a72
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: pt-BR (pt_BR); Calc: CL
(In reply to Marcelo from comment #0)
> Additional Info:
> Built-in style "Figure" doesn't seen to be affected by this bug on version
> 126.96.36.199 - it is affected in version 188.8.131.52.
Do you mean that files created with 5.4.7 or older are immune to this bug even when opened in a newer version?
Please attach an example document.
Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.
(In reply to Buovjaga from comment #1)
> Do you mean that files created with 5.4.7 or older are immune to this bug
> even when opened in a newer version?
No, unfortunately not. I tried creating a new writer document with the previous version, as you asked, but it still loses the cross-reference category when opened in 184.108.40.206.
And actually, it's the other way around: I didn't notice, but "Figure" is not a built-in style in version 5.4.7 - and that is why you don't lose the cross-reference category text if you create the file with version 6 and open it in version 5.
What seems to be the case is that LibreOffice enforces built-in styles based on it's "interface language", not the "document language" - and that's why you lose the cross-ref category when you try to edit it in another LibreOffice language.
I will create an example file and upload it.
Created attachment 162059 [details]
Example file. Created in LibreOffice version 220.127.116.11, en-US interface.
As promised, I created an example file for you. LibreOffice version 18.104.22.168, en-US interface.
Another interesting thing: I created a custom category based on the built-in name of the Portuguese version, Figura (which translates to "Illustration" in that same version, en-US interface), and did the same instructions as my original question. Guess what: not only did it it lose the category of the cross-reference, it also updated the "custom" category (for the en-US interface) 'Figura' count. The last "Figura 1" was updated to "Figura 2".
I also tried opening the file in LibreOffice version 22.214.171.124, but, since the new built-in equivalent of pt-BR "Figura" is the en-US "Figure", it didn't update the "Figura" count, but at least it didn't lose the category of the cross-ref.
(In reply to Marcelo from comment #3)
> Created attachment 162059 [details]
> Example file. Created in LibreOffice version 126.96.36.199, en-US interface.
Wow, yeah that is super weird. Basically any change makes the category name disappear, when opened with a non-en-US UI language.
However, when I tried building something from scratch based on your steps in the description (using Illustration), I could not create such a problematic document.
Are you able to create such broken documents with version 6.4.x?
Arch Linux 64-bit
Build ID: 43bdac0ebd65dfc32a0b8cf2c42fde88ad585e3f
CPU threads: 8; OS: Linux 5.7; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Built on 15 June 2020
Created attachment 162069 [details]
Example file. Created in LibreOffice version 188.8.131.52, en-US interface.
(In reply to Buovjaga from comment #4)
> Are you able to create such broken documents with version 6.4.x?
Yup. And I also tried building another document from scratch (attached), with all possible categories of pictures, but the same thing happens - one minor edition and poof, every cross-ref category disappears. The version I used is a portable one:
Version: 184.108.40.206 (x86)
Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU threads: 4; OS: Windows 10.0 Build 16299; UI render: GL; VCL: win;
Locale: pt-BR (pt_BR); UI-Language: en-US
I was using 220.127.116.11 because it's the last approved version in my company - other than this, only portable versions are usable, such as that one.
To be fair, I don't know if there is a solution for that problem.
Argh, sorry, I failed in my reproduction initially: I did not notice I have to press space in the same paragraph where the reference is.
(In reply to Buovjaga from comment #6)
> Argh, sorry, I failed in my reproduction initially: I did not notice I have
> to press space in the same paragraph where the reference is.
No problems =)
I think I get what happened: pressing Enter in front of the cross-ref, or editing any other line that *do not* have any cross-ref doesn't make they disappear.
Also, trying to add any new cross-ref in the new UI language also makes the previous ones go poof (yeah, noticed this right now).