Bug 118684 - FILESAVE DOCX Form control font properties are incorrectly saved
Summary: FILESAVE DOCX Form control font properties are incorrectly saved
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Martin van Zijl
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks: DOCX-ActiveX-Legacy Form-Controls
  Show dependency treegraph
 
Reported: 2018-07-11 05:27 UTC by Gabor Kelemen (allotropia)
Modified: 2018-12-04 22:37 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (10.36 KB, application/vnd.oasis.opendocument.text)
2018-07-11 05:27 UTC, Gabor Kelemen (allotropia)
Details
The same example saved as docx (6.74 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-11 05:28 UTC, Gabor Kelemen (allotropia)
Details
Font settings in the two files for the push button (265.39 KB, image/png)
2018-07-11 05:28 UTC, Gabor Kelemen (allotropia)
Details
Font effects in the two files for the push button (270.48 KB, image/png)
2018-07-11 05:30 UTC, Gabor Kelemen (allotropia)
Details
The docx when manually modified and resaved (6.72 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-11 05:35 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-07-11 05:27:51 UTC
Created attachment 143441 [details]
Example document

Attached odt has some form controls, a push button and a label with text on them.
On export to docx, the font size changes from the default 11 points to 2 points, and the underline and strikethrough properties are set.
Comment 1 Gabor Kelemen (allotropia) 2018-07-11 05:28:17 UTC
Created attachment 143442 [details]
The same example saved as docx
Comment 2 Gabor Kelemen (allotropia) 2018-07-11 05:28:52 UTC
Created attachment 143443 [details]
Font settings in the two files for the push button
Comment 3 Gabor Kelemen (allotropia) 2018-07-11 05:30:23 UTC
Created attachment 143444 [details]
Font effects in the two files for the push button

This happens when a form control is newly created or an odt file is saved, but it does not when an existing docx is loaded, modified and saved.
Comment 4 Gabor Kelemen (allotropia) 2018-07-11 05:35:22 UTC
Created attachment 143445 [details]
The docx when manually modified and resaved

After modification and a resave, font size is retained - I set 13 pt intentionally, not 11 - and the underline and strikethrough effects are not set.
Comment 5 Gabor Kelemen (allotropia) 2018-07-11 05:39:46 UTC
@Zolnai any idea? I see in oox/source/ole/axcontrol.cxx that these controls use the AxFontDataModel::convertProperties so maybe that has some funny defaults?
Comment 6 Xisco Faulí 2018-07-12 15:51:08 UTC
Reproduced in


Version: 6.2.0.0.alpha0+
Build ID: 4b345f95ce7cb09011892bf465cfdf3811adaf8e
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

and

Version: 6.0.0.0.alpha1+
Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

in previous versions, the form button wasn't exported at all...
Comment 7 Xisco Faulí 2018-07-13 10:40:09 UTC
@Balázs Varga, since you assigned yourself bug 118651, I thought you could be interested in this one as well...
Comment 8 Tamás Zolnai 2018-07-17 14:48:13 UTC
(In reply to Gabor Kelemen from comment #5)
> @Zolnai any idea? I see in oox/source/ole/axcontrol.cxx that these controls
> use the AxFontDataModel::convertProperties so maybe that has some funny
> defaults?

Hmm, your intentions sounds good to me. However the right method is the AxFontDataModel::convertFromProperties() I think. This one is called by export. The convertProperties() method is the import method as I see. Based on the code I can't see what the actual issue, but maybe the API properties are defaulted to some weird value.
Comment 9 Commit Notification 2018-12-04 20:19:15 UTC
Martin van Zijl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/1c8eb8ba49340b7b59a9f1a5f28cd8bee06cd4d1%5E%21

tdf#118684 save correct font height in oox 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.