Download it now!
Bug 101856 - MAILMERGE Add conditional to expand / collapse bookmarks
Summary: MAILMERGE Add conditional to expand / collapse bookmarks
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: lhm-limux target:6.2.0
Keywords:
Depends on:
Blocks: Mail-Merge Bookmarks
  Show dependency treegraph
 
Reported: 2016-09-02 09:50 UTC by Jan-Marek Glogowski
Modified: 2020-03-25 14:48 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Example glade bookmarks dialog (9.86 KB, application/xml)
2017-10-27 16:54 UTC, Jan-Marek Glogowski
Details
Screencast trying to use hidden bookmarks (4.15 MB, video/webm)
2019-11-26 13:01 UTC, Michael Weghorn
Details
template with bookmarks that have a condition (26.29 KB, application/vnd.oasis.opendocument.text)
2020-03-25 14:46 UTC, d.sikeler94
Details
mail merge data source for trac30220_bookmarkVisibility (10.35 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-03-25 14:48 UTC, d.sikeler94
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan-Marek Glogowski 2016-09-02 09:50:53 UTC
Currently just sections can have a conditional to show or hide them. But these just work on full span lines.
As a workaround our WollMux extensions uses bookmarks to to show or hide freeform text snippets inside of paragraphs. Obviously this way we have to manipulate each document per record set to get the correct output and can't rely on LO mail merge.

This enhancement proposes to add the same type of condition to bookmarks, so mail merge can expand or collapse them based on DB values. This will also need a new UI to edit the condition.
Comment 1 Buovjaga 2016-09-23 19:55:09 UTC
Sounds good -> NEW.
Comment 2 Jan-Marek Glogowski 2017-10-27 16:54:27 UTC
Created attachment 137327 [details]
Example glade bookmarks dialog
Comment 3 Commit Notification 2018-07-06 08:22:31 UTC
Bernhard Widl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7a586a9c6bf28088c72f163d724d1cb3259e7920

tdf#101856 create bookmarks w/ new hidden/cond attrs, save as odt

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2018-07-06 08:23:55 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=412b1f8d2b03687a13784e3055c5b0f2507dfef2

tdf#101856 Backport parsing of bookmark properties

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2018-07-06 08:24:02 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8c2545153572b32ecba202e52aade84b188dac73

tdf#101856 odt: write/read new bookmark attributes: unit test

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2018-07-06 08:24:09 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=97de51107824b5b3452e5343672c838da4b04b84

tdf#101856: Use bookmark attributes at load

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2018-07-06 08:25:30 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bf4d4a9cad6664bd5772618e31e998942caef77e

tdf#101856 sw: hidden bookmark portions in SwTextFormatter::NewTextPortion()

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Xisco Faulí 2018-08-06 11:37:35 UTC
A polite ping to Jan-Marek Glogowski:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks
Comment 9 Commit Notification 2018-08-29 22:22:16 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3559daee24ea1224d3d40e6a86b10cf37e18443f

tdf#101856 Handle properties of nested bookmarks

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Xisco Faulí 2018-10-11 11:40:17 UTC
Should this enhancement be added to the 6.2 release notes ? -> https://wiki.documentfoundation.org/ReleaseNotes/6.2
Comment 11 Cor Nouws 2018-11-02 11:35:33 UTC
(In reply to Xisco Faulí from comment #10)
> Should this enhancement be added to the 6.2 release notes ? ->
> https://wiki.documentfoundation.org/ReleaseNotes/6.2

I think so..
Comment 12 Heiko Tietze 2019-11-22 14:54:14 UTC
Bump comment 8
Comment 13 Jan-Marek Glogowski 2019-11-22 15:58:27 UTC
I just opened this bug for someone else in Munich at that time. I wasn't either involved in the development, nor in the review and verification, if there was any... So I can't even tell if it's working as requested. I'll ping them, but AFAIK WollMux in the end didn't even use that feature.

Now I'm just wondering, what exactly is missing from the description of the feature request to update the documentation.
Comment 14 Michael Stahl (CIB) 2019-11-22 16:15:51 UTC
the feature sort-of works in the intended use-case, but there are still open issues with it:
* bookmark flags are lost when the bookmark is copy-pasted
* hiding doesn't work when the bookmark spans across multiple paragraphs
Comment 15 Michael Weghorn 2019-11-26 13:01:33 UTC
Created attachment 156126 [details]
Screencast trying to use hidden bookmarks

(In reply to Jan-Marek Glogowski from comment #13)
> I just opened this bug for someone else in Munich at that time. I wasn't
> either involved in the development, nor in the review and verification, if
> there was any... So I can't even tell if it's working as requested. I'll
> ping them, but AFAIK WollMux in the end didn't even use that feature.

I was told that WollMux actually makes use of the feature.

(In reply to Michael Stahl (CIB) from comment #14)
> the feature sort-of works in the intended use-case, but there are still open
> issues with it:
> * bookmark flags are lost when the bookmark is copy-pasted
> * hiding doesn't work when the bookmark spans across multiple paragraphs

Quickly looking at the feature from a user perspective, I didn't understand at once how that's supposed to work exactly, e.g. when the content of the bookmarks is actually hidden. I found that the following steps do in the end lead to the content being hidden (s.a. attached screencast), but that seems a bit weird:
1) open new Writer doc
2) type text "foo bar baz"
3) select "bar", insert hidden bookmark
4) go to end of line, type "Enter" to insert a line break
5) press backspace to remove the line break again

After step 5, the text "bar" is actually hidden, which was a bit confusing for me, but maybe I'm just missing something...

Other idea for a potential improvement: make changing the "Hidden" flag and condition possible from the "Edit bookmark" dialog (doesn't seem to be possible right now)

Maybe showing the UI elements only in experimental mode as suggested in https://gerrit.libreoffice.org/#/c/83509/ may be a way to go until it's been improved and made less confusing?

(WollMux uses the functionality via UNO API, so shouldn't be affected by that.)
Comment 16 Heiko Tietze 2019-11-26 13:23:29 UTC
Bookmarks to hide parts of the text? Would never do nor expect this. Simply use a special character style with font effect attribute hidden.
Comment 17 Michael Weghorn 2019-11-26 14:09:29 UTC
(In reply to Michael Weghorn from comment #15)
> After step 5, the text "bar" is actually hidden, which was a bit confusing
> for me, but maybe I'm just missing something...

mst mentioned on IRC that "some invalidation of the layout was also missing when the flags change". Actually, saving and reopening the file also works.
Comment 18 sdc.blanco 2020-02-17 10:24:06 UTC
(In reply to Michael Stahl (CIB) from comment #14)
> there are still open issues with it:
> * bookmark flags are lost when the bookmark is copy-pasted
Is this bug #56117?
Comment 19 Michael Stahl (CIB) 2020-02-17 13:22:45 UTC
(In reply to sdc.blanco from comment #18)
> (In reply to Michael Stahl (CIB) from comment #14)
> > there are still open issues with it:
> > * bookmark flags are lost when the bookmark is copy-pasted
> Is this bug #56117?

no, that must be a different problem, since the properties that aren't copied didn't exist yet when it was filed
Comment 20 d.sikeler94 2020-03-25 14:46:17 UTC
Created attachment 158984 [details]
template with bookmarks that have a condition
Comment 21 d.sikeler94 2020-03-25 14:48:13 UTC
Created attachment 158985 [details]
mail merge data source for trac30220_bookmarkVisibility
Comment 22 d.sikeler94 2020-03-25 14:48:47 UTC
WollMux doesn't use the feature yet. But there's a commit (https://github.com/sikelerd/WollMux/commit/634a7772787857bf3b1534fb35d042393bce0dad) to change that.

It looks like LibreOffice mail merge doesn't respect the conditional. Steps to reproduce:
1) open trac30220_bookmarkVisibility.odt
2) connect it with trac30220_datasource.ods
3) Start mail merge as a single document.

In the document produced by mail merge all the conditions are removed and all bookmarks are visible.