Bug 122186 - FILESAVE: Input fields saved in DOCX get corrupted
Summary: FILESAVE: Input fields saved in DOCX get corrupted
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-ActiveX-Legacy
  Show dependency treegraph
 
Reported: 2018-12-19 06:34 UTC by Aron Budea
Modified: 2021-11-11 15:40 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODT (8.87 KB, application/vnd.oasis.opendocument.text)
2018-12-19 06:34 UTC, Aron Budea
Details
DOCX saved from ODT in Writer (4.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-12-19 06:34 UTC, Aron Budea
Details
DOCX saved from ODT in Writer (with Protect Form) (4.32 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-12-19 06:36 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2018-12-19 06:34:06 UTC
Created attachment 147658 [details]
Sample ODT

The attached ODT contains an 'Input list' and an 'Input field', both added to an empty document via Insert -> Field -> More fields... / Functions Tab.
This bug report is about what happens if the sample is saved as DOCX, and opened in Writer / Word.
Note that Writer currently has limited support for Word's different types of form controls, this issue is just about patching up the export code to produce reasonably working controls.

In Word, for legacy form elements (the ones these are supposed to be exported as) to be fillable, 'Restrict Editing' has to be set with 'Editing restrictions' set to only allow 'Filling in forms'. In Writer the corresponding setting is a compatibility option: 'Protect Form' in Options -> LibreOffice Writer -> Compatibility. In Writer the form elements can be filled even if the 'Protect Form' compatibility option isn't set.


Thus the expected behavior would be the following:

1. If compatibility option 'Protect Form' is not set during save:
 a. In Writer the input fields should be fillable as is, the text should be editable.
 b. In Word the input fields should be fillable after setting 'Editing restrictions' to 'Filling in forms'.

2. If compatibility option 'Protect Form' is set during save: 
 a. Both in Writer and Word the text should read-only, but the input fields should be fillable.

 
Actual behavior:

1.a. In Writer the list remains, but no entries can be selected, the field disappears.
1.b. In Word the field disappears, the list seems to be editable after restricting to 'Filling in forms' (might still be corrupted, didn't check in detail).

2.a. In Writer the document is a single read-only region that otherwise is similar to 1.a. In Word the document is restricted, but the whole region is editable (input list doesn't work, and the field disappears in this case as well).
 
 
Observed using LO 6.3.0.0.alpha0+ (2018-12-18, 2b9739b9b009de93efa4f24995469c3bb9d82261) & 4.0.0.3 / Windows 7.
Comment 1 Aron Budea 2018-12-19 06:34:48 UTC
Created attachment 147659 [details]
DOCX saved from ODT in Writer
Comment 2 Aron Budea 2018-12-19 06:36:10 UTC
Created attachment 147660 [details]
DOCX saved from ODT in Writer (with Protect Form)
Comment 3 Commit Notification 2019-01-15 01:00:44 UTC
Tamás Zolnai committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/35ea8fc24ae749b8a87b7ddb5df22ecc4f58cfd3%5E%21

tdf#122186: Fix broken Input list after RT in DOCX format

It will be available in 6.3.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 4 Cor Nouws 2019-02-09 21:09:35 UTC
(In reply to Commit Notification from comment #3)
> Tamás Zolnai committed a patch related to this issue.
> It has been pushed to "master":

In 63Master:

(In reply to Aron Budea from comment #0)
> Actual behavior:
> 
> 1.a. In Writer the list remains, but no entries can be selected, the field
> disappears.
in Writer items can be selected in the list in docx-export.

> 1.b. In Word the field disappears, the list seems to be editable after
> restricting to 'Filling in forms' (might still be corrupted, didn't check in
> detail).
I could not select another item from the list.

So one OK in this WIP issue.
Comment 5 Aron Budea 2019-03-30 23:04:57 UTC
The fields inserted via the Fields dialog aren't supposed to behave like MS Word's form fields (and export to DOC(X) formats "corretly"), the new way is via the Form menu, after enabling 'Reorganize Forms menu to have it MS compatible' among Writer's Compatibility options. The new feature is thanks to Tamas, and have been implemented in his "MSForms" etc. commits recently.