Bug 131527 - FILESAVE DOCX Mail merge field name with starting or ending space saved incorrectly
Summary: FILESAVE DOCX Mail merge field name with starting or ending space saved incor...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx, implementationError
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2020-03-24 11:27 UTC by NISZ LibreOffice Team
Modified: 2022-10-21 20:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer (8.53 KB, application/vnd.oasis.opendocument.text)
2020-03-24 11:27 UTC, NISZ LibreOffice Team
Details
The original file saved by Writer to docx (4.43 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-03-24 11:29 UTC, NISZ LibreOffice Team
Details
The docx export fixed up by Word 2013 (12.80 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-03-24 11:30 UTC, NISZ LibreOffice Team
Details
Test data source (8.77 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-03-24 11:30 UTC, NISZ LibreOffice Team
Details
Screenshot of the example docx opened in Word – Field with starting space not found (27.44 KB, image/png)
2020-03-24 11:31 UTC, NISZ LibreOffice Team
Details
Screenshot of the example docx opened in Word – Field with ending space not found (28.47 KB, image/png)
2020-03-24 11:31 UTC, NISZ LibreOffice Team
Details
Example file from Writer - with more characters (10.66 KB, application/vnd.oasis.opendocument.text)
2020-03-27 12:46 UTC, NISZ LibreOffice Team
Details
The original file saved by Writer to docx (4.56 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-03-27 12:47 UTC, NISZ LibreOffice Team
Details
The docx export fixed up by Word 2013 (13.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-03-27 12:49 UTC, NISZ LibreOffice Team
Details
Screenshot of the updated file in Word (41.93 KB, image/png)
2020-03-27 12:52 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-03-24 11:27:45 UTC
Created attachment 158919 [details]
Example file from Writer

If a mail merge field name contains a space at the start or end in the data source, inserting in a Writer document results in an incorrect field name that Word can not find in the same data source.
If the field name contains no starting or ending space, Word can find it in the same data source. Upon saving it ignores the starting space and replaces the ending one with an underscore.

Steps to reproduce:
1.	Open attached example document in Writer and save it in DOCX format
2.	Open the document in Word
3.	Choose Mailings – Select Recipients – Use an existing list
4.	Browse the attached data source XLSX
5.	Click Preview Results button in the Mailings ribbon

Actual results:
A dialog pops up that says the Firstname and Lastname fields cannot be found in the data source, asks to choose existing fields.

Expected results:
Data fields are found when Preview Results is selected.

LibreOffice details:
Version: 7.0.0.0.alpha0+ (x64)
Build ID: ec85ed21a960a198a01778cdb89a91fabcb5d0c0
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: GL; VCL: win; 
Locale: en-US (hu_HU); UI-Language: en-US
Calc: CL
Comment 1 NISZ LibreOffice Team 2020-03-24 11:29:48 UTC
Created attachment 158920 [details]
The original file saved by Writer to docx
Comment 2 NISZ LibreOffice Team 2020-03-24 11:30:06 UTC
Created attachment 158921 [details]
The docx export fixed up by Word 2013
Comment 3 NISZ LibreOffice Team 2020-03-24 11:30:43 UTC
Created attachment 158922 [details]
Test data source
Comment 4 NISZ LibreOffice Team 2020-03-24 11:31:03 UTC
Created attachment 158923 [details]
Screenshot of the example docx opened in Word – Field with starting space not found
Comment 5 NISZ LibreOffice Team 2020-03-24 11:31:19 UTC
Created attachment 158924 [details]
Screenshot of the example docx opened in Word – Field with ending space not found
Comment 6 NISZ LibreOffice Team 2020-03-27 12:46:49 UTC
Created attachment 159066 [details]
Example file from Writer - with more characters

Also found that slash and dot are problematic. Replacement field names - if they are the same - are autonumbered.
Comment 7 NISZ LibreOffice Team 2020-03-27 12:47:32 UTC
Created attachment 159067 [details]
The original file saved by Writer to docx
Comment 8 NISZ LibreOffice Team 2020-03-27 12:49:38 UTC
Created attachment 159068 [details]
The docx export fixed up by Word 2013
Comment 9 NISZ LibreOffice Team 2020-03-27 12:52:34 UTC
Created attachment 159069 [details]
Screenshot of the updated file in Word
Comment 10 Dieter 2020-10-18 06:38:34 UTC
I confirm it with

Version: 7.0.2.2 (x64)
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: he-IL (de_DE); UI: en-GB
Calc: threaded
Comment 11 QA Administrators 2022-10-19 03:33:43 UTC Comment hidden (obsolete)
Comment 12 Dieter 2022-10-21 20:51:23 UTC
Still present in

Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL