Bug 117212 - MAILMERGE: Save/Print Merged Documents command processes every record even when it is unnecessary
Summary: MAILMERGE: Save/Print Merged Documents command processes every record even wh...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.3.2 release
Hardware: All All
: medium normal
Assignee: Balázs Varga
URL:
Whiteboard: target:7.2.0
Keywords: perf
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
 
Reported: 2018-04-24 15:20 UTC by Gabor Kelemen
Modified: 2021-04-22 14:14 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example mail merge file (10.95 KB, application/vnd.oasis.opendocument.text)
2018-04-24 15:20 UTC, Gabor Kelemen
Details
Example mail merge data source with 3000 rows (81.89 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-04-24 15:22 UTC, Gabor Kelemen
Details
Let's save the first three merged document (118.20 KB, image/png)
2018-04-24 15:25 UTC, Gabor Kelemen
Details
Screenshot of the problem: Writer merges all documents even if only a few is requested (125.31 KB, image/png)
2018-04-24 15:26 UTC, Gabor Kelemen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen 2018-04-24 15:20:30 UTC
Created attachment 141598 [details]
Example mail merge file

If we have a large data source and we want to save/print the last few or the first few lines using Save Merged Documents or Print Merged Documents functions, the unification of the individual documents is unnecessarily slow, because the process goes through all the records.

Steps to reproduce:
1. Create a large data source in Excel/Calc
2. Create a new *.ods file in LibreOffice Writer and create a Mail Merge with the “Mail Merge Wizard...”
3. Use the “source.xlsx” table as a data source.
4. Insert some Mail merged fields into the document and pair it with the data source columns
5. Turn on the “Mail merge” toolbar at the View-→Toolbars.
6. On the Mail merge toolbar click on the “Save Merged Documents” or “Print Merged Documents” and choose the “From 1 To 3” Save As option in the pop-up window.
7. Click on the Save Documents


Actual results:
Mail Merge processes on every record when creating letters, even if we want to use only a subset of the source (e.g.: the first 3 lines from the table). This makes the mailmerge unnecessarily slow when dealing with large source file, even when only a few letters are created at a time.

Expected results:
Mail Merged should not processes every record when creating letters, if we want to use only a subset of the source (e.g.: the first 3 lines from the data source).

Version: 6.0.4.0.0+
Build ID: 30db8c9b1d9654e62c11657140fac24f0f52c547
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:libreoffice-6-0, Time: 2018-03-27_01:00:13
Locale: hu-HU (hu_HU); Calc: group
Comment 1 Gabor Kelemen 2018-04-24 15:22:15 UTC
Created attachment 141599 [details]
Example mail merge data source with 3000 rows
Comment 2 Gabor Kelemen 2018-04-24 15:25:22 UTC
Created attachment 141602 [details]
Let's save the first three merged document
Comment 3 Gabor Kelemen 2018-04-24 15:26:28 UTC
Created attachment 141603 [details]
Screenshot of the problem: Writer merges all documents even if only a few is requested
Comment 4 Buovjaga 2018-05-14 17:28:05 UTC
Setting to NEW
Comment 5 Thierry Munoz 2020-11-21 20:41:26 UTC
I confirm this behavior on my system :
Version: 7.0.3.1
Build ID: 00(Build:1)
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Ubuntu package version: 1:7.0.3-0ubuntu0.18.04.1
Calc: threaded
Comment 6 Commit Notification 2021-03-31 10:25:34 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

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

tdf#117212 sw mailmerge: merge only the selected range

It will be available in 7.2.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 7 NISZ LibreOffice Team 2021-04-09 09:25:21 UTC
Verified in:

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 7c6605bd2c1b27c12c4a492921e537eb4bf5a98e
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded
Comment 8 Commit Notification 2021-04-22 14:14:37 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7d4506f89eba5c6b4edf1590c87e90d478fd179b

tdf#109120 tdf#117212 count letters starting with 1

It will be available in 7.2.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.