Bug 125338 - Saving DOC(M) as DOCX doesn't get rid of macro
Summary: Saving DOC(M) as DOCX doesn't get rid of macro
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.4 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords: filter:docx, implementationError
: 129216 (view as bug list)
Depends on:
Blocks: DOCX-Corrupted Macro-VBA
  Show dependency treegraph
 
Reported: 2019-05-17 12:20 UTC by Aron Budea
Modified: 2023-05-18 14:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOC w macro (33.50 KB, application/msword)
2019-12-06 01:58 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2019-05-17 12:20:42 UTC
After the fix of bug 108269 the macros in DOCM files are roundtripped.
However, when saving a DOCM as DOCX, the macros should be removed, which does not happen currently.

Eg. after saving attachment 133753 [details] (a DOCM with a macro) as DOCX and reloading it, the usual macro dialog will show. Word fails to open such a DOCX.

Observed using LO 6.3.0.0.alpha0+ (d6e8e41c22023bc15cc4c9659b33c1cc3d6edb75), 5.4.0.3 / Windows 7.
Versions before 5.4 would be fine, because macros got discarded during save.
Comment 1 Aron Budea 2019-05-17 12:23:01 UTC
Btw, saving the file as ODT, then reloading and saving it as DOCX is a workaround.
Comment 2 raal 2019-05-20 16:13:11 UTC
Confirm with Version: 6.3.0.0.alpha0+
Build ID: 630db80d17616d635cf2e5f1d5a0852428b794a3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: x11;
Comment 4 himajin100000 2019-09-07 09:42:45 UTC
oops,the last line was a typo.

https://opengrok.libreoffice.org/xref/core/sc/source/filter/excel/xestream.cxx?r=09cd0e36#1082
Comment 5 Aron Budea 2019-12-06 01:58:41 UTC
Created attachment 156343 [details]
Sample DOC w macro

Same thing happens if the source is a DOC with macro. Attaching attachment 133753 [details] converted to DOC in Word as a sample for that.
When converted to DOCX in LO, the macro persists.
Comment 6 Aron Budea 2019-12-06 02:02:20 UTC
*** Bug 129216 has been marked as a duplicate of this bug. ***
Comment 7 QA Administrators 2021-12-06 04:05:41 UTC Comment hidden (obsolete)
Comment 8 Aron Budea 2021-12-06 04:40:23 UTC
Still in LO 7.4.0.0.alpha0+ (ba7db98cca3d8516697c94ef0d6af27db9e1655e) / Ubuntu.
Comment 9 Commit Notification 2022-12-20 14:47:18 UTC
offtkp committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cbca5617387aaa39c9ee86272166bb3df7874b25

tdf#125338 Do not export macros when saving as .docx

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