Bug 148494 - FILESAVE DOCX Field MacroButton saved incorrectly
Summary: FILESAVE DOCX Field MacroButton saved incorrectly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL: https://support.microsoft.com/en-us/o...
Whiteboard: target:7.4.0 target:7.3.4
Keywords:
Depends on:
Blocks: DOCX-Fields
  Show dependency treegraph
 
Reported: 2022-04-10 14:36 UTC by Gabor Kelemen (allotropia)
Modified: 2022-04-16 18:42 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2013 (11.33 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-04-10 14:36 UTC, Gabor Kelemen (allotropia)
Details
The example file saved by Writer master (8.99 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-04-10 14:37 UTC, Gabor Kelemen (allotropia)
Details
The original and exported files in Word 2013 in field codes view (51.69 KB, image/png)
2022-04-10 14: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) 2022-04-10 14:36:56 UTC
Created attachment 179438 [details]
Example file from Word 2013

Attached document contains a MergeButton field.
This is imported correctly as a field in Writer (the built-in Word macros set in the field do not work though, which is a different issue).
Saving the file as DOCX is breaking the field, which has less separator spaces than originally. 
Writer won't recognize it as field after reload while Word recognizes it as field, but does not work until the missing space is added.

1, Open attached file in Word, right click on the field and choose Edit Field.
2, Notice it is a MacroButton type field, with "Hello World" as Display text and "AllCaps" as Macro name (from the built-in Word macro library).
2, Open the file in Writer, save as DOCX and open that in Word
3, Now in Word right click on the field and choose Edit Field.
4, Word shows the field as "MACROBUTTONAllCaps Hello World" 

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: cf4d5ed026c8799a70432a832a8a707c2e316216
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded Jumbo

Export behavior is the same back to 4.1, before it was even worse, this was not even exported as field.
Comment 1 Gabor Kelemen (allotropia) 2022-04-10 14:37:37 UTC
Created attachment 179439 [details]
The example file saved by Writer master
Comment 2 Gabor Kelemen (allotropia) 2022-04-10 14:41:08 UTC
Created attachment 179440 [details]
The original and exported files in Word 2013 in field codes view
Comment 3 Xisco Faulí 2022-04-15 15:04:18 UTC
Reproduced in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: ab8d141967111ca81f4607db3618bb09214e42db
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

and Word 2016
Comment 4 Xisco Faulí 2022-04-15 15:59:53 UTC
Proposed fixed in https://gerrit.libreoffice.org/c/core/+/133077
Comment 5 Commit Notification 2022-04-15 17:18:41 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#148494: export: Always add space separator

It will be available in 7.4.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 6 Commit Notification 2022-04-16 18:42:20 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

tdf#148494: export: Always add space separator

It will be available in 7.3.4.

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.