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.
*** Bug 161264 has been marked as a duplicate of this bug. ***
https://gerrit.libreoffice.org/c/core/+/187150
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ef3b11f811e1fd3852a22881d712afda03a0238f tdf#156061: don't hide DB fields when not in mail merge It will be available in 26.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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e488d7190d53ae236ad5fc89a0c2577e7f564fc2 tdf#156061: fix UI strings for EmptyDbFieldHidesPara compat option It will be available in 26.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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/0c0496b2902a00639e37ed57dd753a8445f9ef97 tdf#156061: don't hide DB fields when not in mail merge It will be available in 25.8.0.0.beta2. 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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/1d7f160f9a0f01ce74bf306a86bd9e8a9f291a7e tdf#156061: fix UI strings for EmptyDbFieldHidesPara compat option It will be available in 25.8.0.0.beta2. 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.