Bug 118166 - FILEOPEN DOCX Document with Form Controls always opens in design mode
Summary: FILEOPEN DOCX Document with Form Controls always opens in design mode
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.2.0
Keywords:
Depends on:
Blocks: Form-Controls
  Show dependency treegraph
 
Reported: 2018-06-14 13:45 UTC by Gabor Kelemen (allotropia)
Modified: 2019-09-21 12:12 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example odt file from LO - works fine (9.81 KB, application/vnd.oasis.opendocument.text)
2018-06-14 13:45 UTC, Gabor Kelemen (allotropia)
Details
Same content in docx, opens in Design mode (19.02 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-14 13:46 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the problem (99.32 KB, image/png)
2018-06-14 13:46 UTC, Gabor Kelemen (allotropia)
Details
Counter example file with dropdown list (17.75 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-20 09:41 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-06-14 13:45:30 UTC
Created attachment 142734 [details]
Example odt file from LO - works fine

If we create/insert any kind of Form control element, and we switch off the Design Mode, the its status is retained fine in *.odt format.
But if we save as *.docx and reload the file or just open a *.docx file from Word which contains Form controls, LibreOffice will turn on automatically the Design Mode. 

Steps to reproduce:
1. Create a new *.docx file with LibreOffice Writer.
2. Insert any kind of Form Control elements into the document and switch off the Design Mode.
3. Save the file and reload the file.

Actual results:
LibreOffice will turn on automatically the Design Mode if there is a Form control element in the *.docx file.

Expected results:
LibreOffice should not turn on automatically the Design Mode if there is a Form control element in the *.docx file.

Verzió: 6.0.4.2
Build az.: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf
CPU szálak: 4; OS: Windows 10.0; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: CL

Version: 6.2.0.0.alpha0+
Build ID: fb8e6a6f44839f09fcd19dc500db33232bc4e15a
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-06-11_01:15:16
Locale: hu-HU (hu_HU); Calc: group threaded
Comment 1 Gabor Kelemen (allotropia) 2018-06-14 13:46:01 UTC
Created attachment 142735 [details]
Same content in docx, opens in Design mode
Comment 2 Gabor Kelemen (allotropia) 2018-06-14 13:46:21 UTC
Created attachment 142736 [details]
Screenshot of the problem
Comment 3 Dieter 2018-06-14 14:25:56 UTC
Can't reproduce with

Version: 6.1.0.0.beta1 (x64)
Build ID: 8c76dfe1284e211954c30f219b3a38dcdd82f8a0
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (de_DE); Calc: CL
Comment 4 Susan Gessing 2018-06-15 19:12:51 UTC
Was able to reproduce with:

Version: 6.0.5.1 (x64)
Build ID: 0588a1cb9a40c4a6a029e1d442a2b9767d612751
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
Locale: en-US (en_US); Calc: CL


1) Created new docx file in Writer.
2) Added a label form control and unselected Design Mode.
3) Saved file, ensuring it saves as a docx.
4) Reopened the file and observed Edit->Design Mode.
5) Design mode was selected.

Also confirmed with same steps with:

Version: 6.2.0.0.alpha0+
Build ID: b1740fba0d1e6e3d69c3781734509317f42a0e4f
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-06-15_08:49:04
Locale: en-US (en_US); Calc: CL
Comment 5 Xisco Faulí 2018-06-18 17:03:19 UTC
Also reproducible in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.10; Render: default; 

and

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e
Comment 6 Gabor Kelemen (allotropia) 2018-06-20 09:41:33 UTC
Created attachment 142958 [details]
Counter example file with dropdown list

If there is a dropdown list control in the docx file, that file does not open in Design mode.
Comment 7 Justin L 2018-10-27 19:21:44 UTC
(In reply to Gabor Kelemen from comment #6)
> Counter example file with dropdown list that does not open in Design mode.
This example has a true Sdt element (m_pImpl->m_pSdtHelper->hasElements()), so
        // Form design mode is enabled by default in Writer, not in Word.
        xFormLayerAccess->setFormDesignMode(false);

The example in comment 0 has an OLE checkbox which does not trigger the no-design-mode setting.  So that suggests that we need another flag, so that

        if(xSInfo->supportsService("com.sun.star.drawing.ControlShape"))
            m_rDomainMapper.hasControls(true);
Comment 8 Justin L 2018-10-29 05:08:11 UTC
proposed fix at https://gerrit.libreoffice.org/62491
Comment 9 Commit Notification 2018-11-06 06:20:26 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/8f8d6bee47b5c41ef551e18d2f9d117d82f01e3f%5E%21

tdf#118166 writerfilter: no design mode if ole controls exist

It will be available in 6.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.