Bug 89346 - MAIL MERGE: Document preview does not handle conditional text correctly
Summary: MAIL MERGE: Document preview does not handle conditional text correctly
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) macOS (All)
: low minor
Assignee: Not Assigned
Depends on: 70346
Blocks: Mail-Merge
  Show dependency treegraph
Reported: 2015-02-12 17:24 UTC by ssch
Modified: 2018-03-29 19:30 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

document template, calc sheet, database and printed mil merge document (59.16 KB, application/zip)
2015-03-02 20:15 UTC, ssch

Note You need to log in before you can comment on or make changes to this bug.
Description ssch 2015-02-12 17:24:48 UTC

I've found a display bug in the document preview of the mail merge assistant.

Steps to reproduce:

1. create a document
2. link a spreadsheet as database
3. insert database fields
4. create a conditional text with following condition
4.1 condition: [title] != ""
4.2 then: " "
4.3 else: ""
5. use mail merge assistant and click through the setting until document preview
6. scroll through the previewed data (filled fields) if the condition would be false the empty field is suppressed but the conditional whitespace is still in preview.

If I print/save the mail merge document, all fields and conditional text are handled correctly. So I think this is just a bug of the document preview of mail merge which does not solve the condition properly.

In my case I wanted to display just a whitespace if there is a title (academic grade) to print for the address field.

Comment 1 Alex Thurgood 2015-02-25 15:24:52 UTC
Please provide test document and datasource for us to try and reproduce. Not all of us are db experts or mailmerge pros.

In addition, what you don't specify, but is implied, is that your datasource has a field called title, for which some of the records are empty in the spreadsheet. This kind of implicit omission makes it harder for inexperienced mailmerge/db Qaers to try and reproduce the buggy behaviour.

Setting to NEEDINFO pending requested information. pLease set back to UNCONFIRMED once you have provided it.
Comment 2 ssch 2015-03-02 20:15:03 UTC
Created attachment 113838 [details]
document template, calc sheet, database and printed mil merge document

Hi Alex,

sure, I've wrapped all needed data to the attached zip archive.
the screenshot shows the behavior if the conditional text (whitespace) is not calculated correctly by the mail merge assistant.
The test-letter.odt is the printed mail merge document to show, that after printing the document, the conditional text ist calculated correctly.

the database can be used to register with LO for mail merge assistant.
Hope there are all needed infos. :)

Comment 3 Alex Thurgood 2015-03-17 09:28:13 UTC
Confirming on

Build ID: 34d6ec2c6e6618beacac881ec28ab527b25558d1
Locale: fr_

OSX 10.10.2

when the document preview is displayed, the added whitespace is visible, however, this is not so in the final document (which is correct), so the preview is wrong.
Comment 4 Jan-Marek Glogowski 2015-03-20 12:39:18 UTC
Can someone please veryfy, if my fix for the regression for bug 70346 fixed your problem?
Comment 5 tommy27 2016-04-16 07:23:07 UTC Comment hidden (obsolete)
Comment 6 eisa01 2018-03-29 19:30:56 UTC
Had some trouble understanding how to test this (how to get the preview), but think I figured it out in the end.

Comparing with current master, there is no space before Max, so this works for me

Build ID: a488c7ad2763b944713997911c1ddb0315d8c93f
CPU threads: 2; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2018-03-26_00:38:29
Locale: en-US (en_US.UTF-8); Calc: group