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: UNCONFIRMED
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: QA:needsComment
Keywords: filter:docx, implementationError
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2020-03-24 11:27 UTC by NISZ LibreOffice Team
Modified: 2020-04-11 03:30 UTC (History)
1 user (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