Description: I have a problem with mergeFields. If the value is white space, the text disappears. In LibreOffice the entire paragraph that contains it disappears. In WordPad works perfectly. Steps to Reproduce: 1. Open a file with mergeFields the contains white space Actual Results: Only 3 paragraphs appear in the document Expected Results: 4 paragraphs should appear in the document Reproducible: Always User Profile Reset: No Additional Info: 4 paragraphs should appear in the document
Created attachment 188094 [details] File with the problem
I Have a problem with mergeFields. If the value is white space, the text disappears. In LibreOffice the entire paragraph that contains it disappears. In WordPad works perfectly. I add file here.
*** Bug 156060 has been marked as a duplicate of this bug. ***
Likely related to commit db04be037b611e296ef9f2542322c52ed82d7a2b. However, the function that checks if the paragraph should be hidden only checks that field text is empty - i.e., no characters. Some whitespace is not empty, so should not make it hidden. Thus, it is likely an import issue, turning whitespace into nothing. Interesting, if it worked between 6.1 (where the feature was implemented) and 7.5?
I have only tested it in version 7.5
(In reply to Mike Kaganski from comment #4) > Likely related to commit db04be037b611e296ef9f2542322c52ed82d7a2b. > However, the function that checks if the paragraph should be hidden only > checks that field text is empty - i.e., no characters. Some whitespace is > not empty, so should not make it hidden. Thus, it is likely an import issue, > turning whitespace into nothing. > > Interesting, if it worked between 6.1 (where the feature was implemented) > and 7.5? Testing with "Tools > Options > Writer > Compatibility > Hide paragraphs of database fields" on: - 6.1 build at db04be037b611e296ef9f2542322c52ed82d7a2b shows the paragraph. - starts being hidden in 7.2 I had to bisect in --safe-mode. Bibisected with linux-64-7.2 repo to first bad commit 426308e0d943e62cfe25211ced21fa90c02a97ac which points to core commit: commit ac14ed9f26582701032a28cb424f2b6bf35ca7fd author Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Wed Dec 09 09:11:24 2020 +0100 committer Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Thu Dec 10 16:50:42 2020 +0100 Don't show HiddenParagraphs by default Showing them means that the layout is different from what is printed. This probably shouldn't be the default. The similiar HiddenCharacter is also false by default. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107385 I don't understand the feature(s) enough to judge if that was by design. Samuel and Mike?
(In reply to Stéphane Guillou (stragu) from comment #6) Thank you; the setting changed in that commit is about showing *on screen*. The file, when opened in Word, has that paragraph shown even on print preview. In Writer 6.1, it hides the paragraph on print preview, so no need to bisect further.
It looks like the feature implemented in bug 35798 Needs fixing. Empty mail merge fields should not hide anything in the source document; only the merge itself should perform the hide. FTR: Word seems to only hide when the paragraph after the merge only contains whitespace. So paragraphs with labels in plain text (not as Word's merge field's \b argument) would not hide; and fields containing space (not exactly empty) would hide. I am unsure if this exact processing should be implemented; anyway, even if, it's separate.