Bug 148294 - Manually created references are not exported correctly to .docx (referenced text lost)
Summary: Manually created references are not exported correctly to .docx (referenced t...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
: 153713 (view as bug list)
Depends on:
Blocks: Fields-Cross-Reference DOCX-Fields
  Show dependency treegraph
 
Reported: 2022-03-31 15:51 UTC by Orwel
Modified: 2024-03-12 14:31 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Original file with set references (.odt) (12.96 KB, application/vnd.oasis.opendocument.text)
2022-03-31 15:52 UTC, Orwel
Details
from original file saved .docx with lost reference (4.86 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-03-31 15:52 UTC, Orwel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Orwel 2022-03-31 15:51:46 UTC
Description:
If you create own reference in LO and save file as .docx, reference will be lost.

Steps to Reproduce:
1. Write text
2. Set some reference (cross reference – set reference)
3. Insert reference (cross reference – insert reference /  refer using referenced text): 
4. save file as docx
5. open saved docx file


Actual Results:
reference is lost (if visible after reopening, update fields)

Expected Results:
reference should not be lost 


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Tested on actual version:
Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0
CPU threads: 16; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: sk-SK (sk_SK); UI: en-GB
Calc: CL
Comment 1 Orwel 2022-03-31 15:52:19 UTC
Created attachment 179238 [details]
Original file with set references (.odt)
Comment 2 Orwel 2022-03-31 15:52:59 UTC
Created attachment 179239 [details]
from original file saved .docx with lost reference
Comment 3 Orwel 2022-03-31 15:55:16 UTC
I would like amend that the first version affected was probably also some earlier, but I can not remember.

If you re-save the original .odt file to .doc (not .docx)the reference is present.
Comment 4 sdc.blanco 2022-03-31 16:09:25 UTC
repro

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 7ac19fbce8a35f559eebb879cd0f232bfc95e703
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL

Additional information: 
1. In Navigator, Reference in .odt file becomes Bookmark in .docx file
2. Not a problem if cross reference is made to page number
Comment 5 Telesto 2022-03-31 21:53:17 UTC
Setting to NEW based on comment 4
Comment 6 Telesto 2022-04-03 16:32:14 UTC
Repro
Version: 7.2.1.0.0+ (x64) / LibreOffice Community
Build ID: 8fdbb8aed1b48734a717d5f98ada566de7204605
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

and in
Version: 7.0.0.0.beta1+ (x64)
Build ID: 2891e91a513520d68ea2b8c59c14335861a15253
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

and in
Versie: 6.0.4.1
Build ID: a63363f6506b8bdc5222481ce79ef33b2d13c741
CPU-threads: 4; Besturingssysteem: Windows 6.3; UI-render: GL; 
Locale: nl-NL (nl_NL); Calc: CL


and in
Versie: 4.4.7.2 
Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Locale: nl_NL

and in
Versie: 4.1.0.4 
Build ID: 89ea49ddacd9aa532507cbf852f2bb22b1ace28
Comment 7 Telesto 2022-04-03 16:37:57 UTC
@Justin,
Some dev expertise would be lovely.. Is this a file format incompatibility?
Comment 8 Stéphane Guillou (stragu) 2023-02-23 14:04:28 UTC
*** Bug 153713 has been marked as a duplicate of this bug. ***
Comment 9 Stéphane Guillou (stragu) 2023-02-23 14:07:46 UTC
Issue could be related to bug 139835, but for that one, the referenced text disappears directly on reload, whereas this one needs a field update. So I'm keeping them separate.
Comment 10 Orwel 2024-03-08 09:19:31 UTC
Hi, is there some workaround about this bug? I posted it 2 years ago, it was confirmed and is still present in LO 7.6. It makes hard co work with documents which needs to be saved in doc/docx format for exchange issues....
Thank you.
Comment 11 Stéphane Guillou (stragu) 2024-03-12 14:31:46 UTC
(In reply to Orwel from comment #3)
> If you re-save the original .odt file to .doc (not .docx)the reference is
> present.
I can confirm that: text for the cross-reference field is kept in DOC export, even after a field update.
So let's remove DOC from keywords, summary and metas.

Noting that in both format, even though the Reference is converted to a Bookmark, the link is still functional and clicking the cross-reference field still jumps to the Reference.

In LO 3.3.0, reproduced as well when saved as DOCX (text disappears after field update).
(Not inherited as OOo 3.3 didn't have a DOCX export filter.)