Created attachment 153988 [details] Sample doc for mail merge On current master, the printout generated by mail merge is incorrect if the global option to print blank pages is disabled, but the document-specific option is enabled. Sample steps to reproduce: 0) delete existing user profile (e.g.'instdir/user' for dev build) 1) start Writer 2) make sure the following options are set like this in "Tools" -> "Options": * "Load/Save" -> "General" -> "Load user-specific settings with the document" is enabled (default) * "Load/Save" -> "General" -> "Load printer settings with the document" is enabled (default) 3) disable option "LibreOfficeDev Writer" -> "Print" -> "Print automatically inserted pages" 4) open attached document "test_mailmerge.odt" (which has "PrintEmptyPages" set to "true" in settings.xml) 5) run mail merge wizard and set "2.ods" as data source to use (it has 2 records) 6) save the document (required due to another bug that I'll report separately) 7) select "Print merged documents" from the mailmerge toolbar 8) select to print all pages 9) check printout Results: * The printout contains two pages. * The first page contains the printout for the first data record (a page with the word "Hello" on it) * The second page is blank Expected results: * The printout should contain the following pages since the "PrintEmptyPages" option in the document's settings.xml is set to 'true' and document and printer settings should be taken from the document; therefore: * page 1 should contain the printout for the first record (i.e. the word "Hello") * page 2 should be blank * page 3 should contain the printout for the first record (i.e. the word "Hello") Version: 6.4.0.0.alpha0+ Build ID: 111cf7ee0b26a831577c7c03089f9de159aef16d CPU threads: 4; OS: Linux 5.2; UI render: default; VCL: kf5; Locale: en-GB (en_GB.UTF-8); UI-Language: en-US Calc: threaded
Created attachment 153989 [details] Sample data records for mail merge
Bibisecting with "bibisect-linux-64-6.2" shows this is a regression from the following commit: commit cc46e7b9c75ddbcaaefde5f396ba76b0b866fa58 Author: Mike Kaganski <mike.kaganski@collabora.com> Date: Wed Jun 13 15:53:49 2018 +0200 tdf#116537: use page #s excluding empty pages when they are ignored Since commit 3c1a343f6936f1dcefdf79a677f8c26ce29676e6, SwDoc::CalculatePagesForPrinting expects that PageRange contains page numbers that don't include empty pages' numbers, when the org.openoffice.Office.Writer/Print/EmptyPages is false. Change-Id: I4057d6e36765707affbd5f3a4507ae03f4a27171 Reviewed-on: https://gerrit.libreoffice.org/55756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> I'm planning to submit a fix sometime soon.
(In reply to Michael Weghorn from comment #0) > 6) save the document (required due to another bug that I'll report > separately) This other bug is bug 127410.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/7d7f024f23024374219a9485a9e1893a221a30fa%5E%21 tdf#127409 Use document-specific value for "Print empty pages" It will be available in 6.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.
Fixed on master. Pending backport for 6.3: https://gerrit.libreoffice.org/#/c/78757/
Verified in Version: 6.4.0.0.alpha0+ Build ID: c56bf1479cc71d1a2b0639f6383e90c1f7e3655b CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded @Michael Weghorn, thanks for fixing this issue!
Michael Weghorn committed a patch related to this issue. It has been pushed to "libreoffice-6-3": https://git.libreoffice.org/core/+/769d33900a51d5ea253885014f367bac6e8077f3%5E%21 tdf#127409 Use document-specific value for "Print empty pages" It will be available in 6.3.3. 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.