Bug 97318 - Mailmerge wizard & Header > Every record from DB in styles.xml
Summary: Mailmerge wizard & Header > Every record from DB in styles.xml
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2016-01-22 14:28 UTC by spamici
Modified: 2020-02-12 07:11 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Merged individual document for first record (14.23 KB, application/vnd.oasis.opendocument.text)
2016-01-22 14:28 UTC, spamici
Details

Note You need to log in before you can comment on or make changes to this bug.
Description spamici 2016-01-22 14:28:54 UTC
Created attachment 122156 [details]
Merged individual document for first record

Overview : 
when using "Mail Merge Wizard" to save merged documents, every records from the database is written in merged individual documents.

Steps to reproduce :
Prerequisite : a database registered

1. Tools -> "Mail Merge Wizard"
2. Select step 3 : "Insert address block"
3. Click on "Select Different Address List..." button
4. Select the previously registered database and click "Ok"
5. Select step 6 : "Edit document"
6. Click on "Edit Document..." button
7. Click on Insert -> Header -> Default Style
8. In the header, click on Insert -> Fields -> Other... -> Database
9. Add fields from the previously registered database (inside the header)
10. Close the "Fields" window
11. Click on "Return to Mail Merge Wizard"
12. Select step 8 : "Save, print or send"
13. Select "Save merged document"  and "Save as individual documents"
14. Click on "Save Documents" button
15. Choose a name and select a folder. Click on save

Actual Results :
The merged documents are generated but styles.xml files of each generated file contains every records from the database

Expected Results :
The merged documents are generated. styles.xml files of each generated file doesn't contain the whole database.

Date & Hardware : 
2016-01-22 on Debian Jessie x64 (LibO 4.3.3.2)

Additional platform : 
Windows 7 Pro x64 (Lib0 4.4.7.2)
Comment 1 Buovjaga 2016-01-28 15:32:26 UTC
Before testers give it a shot, could you please test with LibreOffice 5.1?
http://www.libreoffice.org/download/pre-releases/
https://wiki.documentfoundation.org/Installing_in_parallel

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists in 5.1. Change to RESOLVED WORKSFORME, if the problem went away.

If the problem persists in 5.1, attaching example files would be good so testers can always test as quickly as possible.
Comment 2 Oliver Specht (CIB) 2016-03-10 16:00:55 UTC
In SwMailMergeOutputPage::SaveOutputHdl_Impl the single documents are copied from the mail merge result file. 
Unused page styles should be removed here.
Comment 3 spamici 2016-03-25 14:50:46 UTC
(In reply to Buovjaga from comment #1)
> Before testers give it a shot, could you please test with LibreOffice 5.1?
> http://www.libreoffice.org/download/pre-releases/
> https://wiki.documentfoundation.org/Installing_in_parallel
> 
> Set to NEEDINFO.
> Change back to UNCONFIRMED, if the problem persists in 5.1. Change to
> RESOLVED WORKSFORME, if the problem went away.
> 
> If the problem persists in 5.1, attaching example files would be good so
> testers can always test as quickly as possible.


I have just tested with  LibO 5.1.1.3 (x64) Build ID: 89f508ef3ecebd2cfb8e1def0f0ba9a803b88a6d (OS : Windows 10 pro x64).

Same problem. (see Attachment 122156 [details] )
Comment 4 QA Administrators 2017-10-23 14:04:00 UTC Comment hidden (obsolete)
Comment 5 Michael Weghorn 2019-10-18 18:28:25 UTC
Still reproducible with current master.

A potential fix for review: https://gerrit.libreoffice.org/#/c/81095/
Comment 6 Michael Weghorn 2020-02-12 07:11:04 UTC
(In reply to Michael Weghorn from comment #5)
> Still reproducible with current master.
> 
> A potential fix for review: https://gerrit.libreoffice.org/#/c/81095/

As mentioned in the Gerrit patch, this needs some further investigation, but I don't really get to that currently. I'm unassigning for now; if anybody else wants to take over, please do.