Bug 113789 - ActiveX button's icon is not saved back to DOCX file
Summary: ActiveX button's icon is not saved back to DOCX file
Status: NEW
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: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx, needsDevEval
Depends on:
Blocks: DOCX-ActiveX-Legacy
  Show dependency treegraph
 
Reported: 2017-11-12 17:15 UTC by Tamás Zolnai
Modified: 2024-11-28 03:12 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
A document with one push button having a small icon (13.89 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-11-12 17:23 UTC, Tamás Zolnai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tamás Zolnai 2017-11-12 17:15:32 UTC
Description:
From version 6.0 LibreOffice can load / save ActiveX controls from / to DOCX format in general. However pictures attached to ActiveX buttons are not handled by the export code.

Steps to Reproduce:
1. Open attached document
2. Save it to a DOCX file
3. Open the save file in LO or MSO

Actual Results:  
After opening the saved DOCX file the picture is missing from the button.

Expected Results:
Picture of the putton should be there after saved to DOCX format.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Comment 1 Tamás Zolnai 2017-11-12 17:23:00 UTC
Created attachment 137695 [details]
A document with one push button having a small icon
Comment 2 Tamás Zolnai 2017-11-12 17:28:21 UTC
Let's turn this into a easy hack. The code is here:
oox/source/ole/axcontrol.cxx
Check AxCommandButtonModel class.
Also might need to check the activex documentation:
https://msdn.microsoft.com/en-us/library/office/cc313125(v=office.12).aspx
Comment 3 Manuj Vashist 2017-12-04 23:41:43 UTC Comment hidden (obsolete)
Comment 4 Tamás Zolnai 2017-12-08 01:45:03 UTC
ActiveX controls' properties are stored in a binary file inside the DOCX file (which is a zipped file structure). You can find this binary here \word\activeX\activex2.bin, inside the DOCX file.
All types of form controls have an importBinaryModel() and exportBinaryModel() method which do the reading and writing of this binary file. The imported value are stored as the specific class member variable (e.g. AxCommandButtonModel::maPictureData) and later this value is converted to an API property (convertProperties), which leads to apply this properties on the opened document. During export we have the same workflow in the oposite direction. We have convertFromProperties() method which gets the currently opened document's properties and sets the member variables based on that. Later the exportBinaryModel() will write this values out into the binary file.
So you will need to set AxCommandButtonModel::maPictureData based on API properties inside convertFromProperties() method and also export this member variable inside exportBinaryModel(). For how to do that you should check what happens by import and you can do the same in the oposite direction.
Comment 5 Tamás Zolnai 2017-12-08 03:27:09 UTC Comment hidden (obsolete)
Comment 6 Xisco Faulí 2018-01-18 03:32:20 UTC Comment hidden (obsolete)
Comment 7 Xisco Faulí 2018-02-18 03:36:51 UTC Comment hidden (obsolete)
Comment 8 Xisco Faulí 2018-03-21 03:34:06 UTC Comment hidden (obsolete)
Comment 9 Xisco Faulí 2018-04-21 02:32:33 UTC Comment hidden (obsolete)
Comment 10 Tamás Zolnai 2018-04-22 12:40:21 UTC Comment hidden (obsolete)
Comment 11 Xisco Faulí 2018-11-04 03:55:18 UTC Comment hidden (obsolete)
Comment 12 Xisco Faulí 2018-12-05 03:47:09 UTC Comment hidden (obsolete)
Comment 13 Xisco Faulí 2019-01-05 03:39:52 UTC Comment hidden (obsolete)
Comment 14 Xisco Faulí 2019-02-05 03:44:16 UTC Comment hidden (obsolete)
Comment 15 Aditya Sahu 2019-03-01 08:39:50 UTC Comment hidden (obsolete)
Comment 16 Aditya Sahu 2019-03-02 21:05:24 UTC Comment hidden (obsolete)
Comment 17 Xisco Faulí 2019-04-02 02:47:19 UTC Comment hidden (obsolete)
Comment 18 Aditya Sahu 2019-04-03 11:57:44 UTC
Un-assigning myself from this bug due to lack of knowledge in the bug that is not too easy. Looking at the bug more closely, Tamás and I found it to be more difficult than thought. I suggest to change the keyword from "difficultyBeginner" to "difficultyInteresting" and add "needsDevEval" to it.
Comment 19 QA Administrators 2022-11-27 03:37:52 UTC Comment hidden (obsolete)
Comment 20 Hossein 2022-11-28 04:36:57 UTC
The problem is still reproducible with LO 7.4:

Version: 7.4.0.3 / LibreOffice Community
Build ID: f85e47c08ddd19c015c0114a68350214f7066f5a
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Also reproducible with the latest LO 7.5 dev master:

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 360b5861fb46353e7a6b9f5abf13339cd719a8df
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 21 QA Administrators 2024-11-28 03:12:48 UTC
Dear Tamás Zolnai,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug