Bug 161264 - FILEOPEN RTF Paragraph with checkbox and mail merge field are not visible
Summary: FILEOPEN RTF Paragraph with checkbox and mail merge field are not visible
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.1 target:24...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: RTF
  Show dependency treegraph
 
Reported: 2024-05-24 18:30 UTC by Gabor Kelemen (allotropia)
Modified: 2024-10-30 16:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file with disappearing paragraph (41.77 KB, application/msword)
2024-05-24 18:30 UTC, Gabor Kelemen (allotropia)
Details
The example file in Word 2016 and in Writer master (75.26 KB, image/png)
2024-05-24 18:30 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2024-05-24 18:30:29 UTC
Created attachment 194338 [details]
Example file with disappearing paragraph

Attached document has a paragraph with a checkbox field and a mail merge field.

When opened in Writer the paragraph is entirely hidden until View - Field Hidden Paragraphs is enabled.

1. Open attached document
-> seems empty, but Navigator shows traces of field/bookmark
2. Choose View - Field Hidden Paragraphs (or: Options - Writer - Formatting Aids - Fields: Hidden paragraphs)
-> Paragraph appears, including non-field content.

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 1b45ca1aa7d7cb8e7adcc07f8c60e26a413eca8c
CPU threads: 14; OS: Windows 10 X86_64 (10.0 build 19045); UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: default

Seems to have started in 6.1 with:

https://git.libreoffice.org/core/+/db04be037b611e296ef9f2542322c52ed82d7a2b

commit db04be037b611e296ef9f2542322c52ed82d7a2b	[log]
author	Mike Kaganski <mike.kaganski@collabora.com>	Fri May 18 18:48:38 2018 +0300
committer	Mike Kaganski <mike.kaganski@collabora.com>	Sun May 20 13:16:28 2018 +0200

tdf#35798: Hide empty Database fields' paragraphs (+ compat option)

In 6.1, disabling the newly added "A database field with empty value hides its paragraph" option makes the paragraph appear even if the "Options - Writer - Formatting Aids - Fields: Hidden paragraphs" is disabled.

In master, enabling Options - Writer - View - Hidden paragraphs is also necessary, so this may not be just about changing the default of the above compat option for RTF to disabled.
Comment 1 Gabor Kelemen (allotropia) 2024-05-24 18:30:59 UTC
Created attachment 194339 [details]
The example file in Word 2016 and in Writer master
Comment 2 Robert Großkopf 2024-05-26 16:58:02 UTC
Could confirm the buggy behavior. Existing text content shouldn't be hidden, if it isn't hidden in the rtf-file. 
It isn't the hidden paragraph. Content is also shown if "View" → "Field Names" is chosen.
Comment 3 Gabor Kelemen (allotropia) 2024-05-28 12:34:39 UTC
Another bibisect in 7.3 shows that the UI behavior changed in:

https://git.libreoffice.org/core/+/86d11097cd4a2ae4a6b4e6b35e28a6075376d67a

author	Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>	Mon Oct 25 02:02:09 2021 +0200
committer	Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>	Fri Oct 29 03:00:47 2021 +0200
tree 104762ecf24daf8e4c617cc372310d642bc46929
parent cae107bab822acc198569750ae5b9a272f7ae996 [diff]

use virtual function call for dynamic dispatch

After this, changing the database field compat option in the Compatibility page does not show the paragraph, only changing the View - Field Hidden Paragraph or View - Field Names commands do.
This may or may not be relevant, maybe just affects the UI working.

Also the behavior is the same if the example is saved as docx in Word. 

So... maybe the paragraph hiding should not happen right after opening, only at mail merge?
Comment 4 Commit Notification 2024-07-15 19:25:19 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

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

tdf#161264 don't hide paragraph with empty mail merge fields

It will be available in 25.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 5 Commit Notification 2024-07-29 22:27:41 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#161264 don't hide paragraph with empty mail merge fields

It will be available in 24.8.1.

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 6 Commit Notification 2024-07-29 22:29:47 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/40987c3a4ca7caf9eea3b631972990ebf6a1f1b5

tdf#161264 don't hide paragraph with empty mail merge fields

It will be available in 24.2.6.

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 Gabor Kelemen (allotropia) 2024-08-12 08:07:13 UTC
Verified in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f7197e574cdbd7410fcadab1632bcce2626dca5a
CPU threads: 14; OS: Windows 10 X86_64 (10.0 build 19045); UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: default

The paragraph is now visible.