Bug 128460 - Exported Writer input fields are not imported correctly from docx
Summary: Exported Writer input fields are not imported correctly from docx
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.4.0 target:6.3.4 target:25.2.0
Keywords: filter:docx
: 100474 107274 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-29 14:16 UTC by Jan-Marek Glogowski
Modified: 2024-08-27 06:59 UTC (History)
4 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 Jan-Marek Glogowski 2019-10-29 14:16:28 UTC
Description:
This bug is about the import side of bug 125103. The patch for bug 125103 changed the format type from FORMTEXT to FILLIN for Writer input fields. But when importing these fields the current text is lost, because Writers' input fields just allow text, but Words FILLIN field allows formatted text.

So to be at least consistent with the patch for bug 125103, LO should import the FILLIN value as plain text (simply ignore all the formatting) and assign its value to the import field.

All this handling is kind of a stretch, but I coudn't find any non-formatting fields in the DOCX specs, so this is probably the least problematic conversion. Interestingly FILLIN is used for mail merge in DOCX, which eventually might lead to interesting side effects.


Steps to Reproduce:
1. save a copy of the ODT document from bug 125103 as DOCX
2. open the created DOCX

Actual Results:
Two form fields are imported, but both have no content.

Expected Results:
The 2nd input field has the content "text" and the reference "fieldinput".


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Oliver Brinzing 2019-11-01 08:03:48 UTC
> Two form fields are imported, but both have no content.

reproducible with:

Version: 6.3.3.2 (x64)
Build-ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: 

Version: 6.4.0.0.alpha1+ (x64)
Build ID: 885ae558d34dd76955c727b90eb9ae52ce85df7f
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

opening exported *.docx with ms word 2016 shows "text", 
with (Alt) + F9:

{FILLIN ""}{FILLIN "fieldinput"}

opening with LO shows a blank document, xml structure is:

<text:p text:style-name="P1">
  <text:text-input text:description=""/>
  <text:text-input text:description="fieldinput"/>
</text:p>
Comment 2 Commit Notification 2019-11-11 10:39:52 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5e279f175289234b91f272bbbf48e70315fff5ac

tdf#128460 import SwInputField from DOCX FILLIN

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Oliver Brinzing 2019-11-17 08:57:16 UTC
with:

Version: 6.5.0.0.alpha0+ (x64)
Build ID: d04eef858250f97690f32dba17f42d157a8767fc
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

This seems to be fixed:

Now possible to open *.docx with ms word, edit, save, and open, edit, save with LO again.

Is it possible to backport this fix to LO 6.3?
Comment 4 Timur 2019-11-17 20:24:30 UTC
Input field seems to work now for DOCX both export and import. 

I guess we have to open separately for DOC.
Comment 5 Commit Notification 2019-11-19 07:09:50 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/90424d0b6d316998ff3e2632add0f0c8da55e3a2

tdf#128460 import SwInputField from DOCX FILLIN

It will be available in 6.3.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Michael Weghorn 2019-11-19 07:10:39 UTC
(In reply to Oliver Brinzing from comment #3)
> Is it possible to backport this fix to LO 6.3?

The patch for 6.3 just landed.

Setting status to VERIFIED FIXED according to comment 4 and comment 5.
Comment 7 NISZ LibreOffice Team 2020-11-25 15:52:58 UTC
*** Bug 100474 has been marked as a duplicate of this bug. ***
Comment 8 Xisco Faulí 2021-06-21 08:44:04 UTC
*** Bug 107274 has been marked as a duplicate of this bug. ***
Comment 9 Commit Notification 2024-08-27 06:59:43 UTC
Adam Seskunas committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/03b31a8ad48e3b8a9e54203ff3856702557757b5

tdf#128460 Add Unit Test

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.