Bug 103091 - An applied conditional paragraph style looses feature on opening
Summary: An applied conditional paragraph style looses feature on opening
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: All All
: medium major
Assignee: Troy Rollo
URL:
Whiteboard: odf target:6.0.0 target:5.4.0.1 targe...
Keywords: bibisected, bisected, dataLoss, regression
Depends on:
Blocks: Writer-Styles-Paragraph
  Show dependency treegraph
 
Reported: 2016-10-10 14:35 UTC by Regina Henschel
Modified: 2018-11-15 10:38 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo with conditional paragraph style (10.23 KB, application/vnd.oasis.opendocument.text)
2016-10-10 14:35 UTC, Regina Henschel
Details
Patch for master branch (7.75 KB, patch)
2017-06-05 09:31 UTC, Troy Rollo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2016-10-10 14:35:21 UTC
Created attachment 127924 [details]
Demo with conditional paragraph style

Open attached document. You should see the first level list items in blue. The applied list style 'My Q A' is a conditional style with 'MyQuestion' for first numbering level and 'MyAnswer' for second numbering level.

It works OK in
Version: 5.2.0.0.alpha0+
Build ID: c910e229aa19edd0502aa05dffedc91dd727da6f
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-12_23:53:45
Locale: de-DE (de_DE)

It is broken in
Version: 5.2.0.0.alpha0+
Build ID: e413549dc8b5669a806eeabc30c7d6f92723a882
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-12-28_23:26:49
Locale: de-DE (de_DE)

The bug can be seen on master too.

I haven't got any version to test in between.
Comment 1 Yousuf Philips (jay) (retired) 2016-10-17 05:37:40 UTC
Confirmed working in 5.1, but not working in 5.2 daily or master.

Version: 5.3.0.0.alpha0+
Build ID: 45a7137c6796f33fbf5b8f7cb64e293260d991cb
CPU Threads: 2; OS Version: Linux 3.19; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-10-13_23:38:06
Locale: en-US (en_US.UTF-8); Calc: group
Comment 2 raal 2016-10-31 16:34:35 UTC
This seems to have begun at the below commit.
Adding Cc: to Bjoern Michaelsen ; Could you possibly take a look at this one?
Thanks
 5bb3328446b430a8ef1215fc591c4b1ed6312e9c is the first bad commit
commit 5bb3328446b430a8ef1215fc591c4b1ed6312e9c
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Fri Dec 25 06:31:32 2015 -0800

    source aef1e2dde5e53ba8416a393bbe155ef0c18511a7

    author    Bjoern Michaelsen <bjoern.michaelsen@canonical.com>    2015-12-21 02:55:14 (GMT)
committer    Bjoern Michaelsen <bjoern.michaelsen@canonical.com>    2015-12-25 12:15:27 (GMT)
commit    aef1e2dde5e53ba8416a393bbe155ef0c18511a7 (patch)
tree    2e08c123f48df648498599d3db4b2bb5b7e1a498
parent    c2b488e5dfa5defb87a6e8392749a9276c3a950f (diff)
move SwXStyle entirely into compilation unit
   
     git bisect log
# bad: [6380ca07b05f68dedcaa379302cfe1fa478571c4] source 60b74fe1775e647545d2da1fcc58a4c63ec18aa5
# good: [1f670510f08cb800cbae2a1dd6ea70d3542e4721] source 49c2b9808df8a6b197dec666dfc0cda6321a4306
git bisect start 'origin/master' 'oldest'
# bad: [38f37b8ec1a2d199bb957cfd2581df7d1b273b74] source c0da1080b61a1d51654fc34fdaeba373226065ff
git bisect bad 38f37b8ec1a2d199bb957cfd2581df7d1b273b74
# bad: [6998931a34ad75eb555f882fbed223e585548721] source 1fbd073828ef52f5206aed4643226bae9fb85f4f
git bisect bad 6998931a34ad75eb555f882fbed223e585548721
# good: [0ea9534d0f4c90833e004706de7c11abe5bc522d] source 97361478e64f11330f7f7aea819d60c7562fb0f6
git bisect good 0ea9534d0f4c90833e004706de7c11abe5bc522d
# bad: [5e4c9cfe6cb41f11e1fb2369ecc31fdfe0e08e82] source 38e965fe0fcabffadb8fabe6756313b4f37daad5
git bisect bad 5e4c9cfe6cb41f11e1fb2369ecc31fdfe0e08e82
# good: [8d42d1252eb187b4b851f7511ff6eae694fa410c] source bfb32ea784b92f8cde0986b8724160ba7570080c
git bisect good 8d42d1252eb187b4b851f7511ff6eae694fa410c
# bad: [18cdd31947f6aa9d38c7ab67d767cccbdbc4a827] source 78c6be9cf3c9c3c87d2f41981bdc61047171eafe
git bisect bad 18cdd31947f6aa9d38c7ab67d767cccbdbc4a827
# bad: [969358ed4f1b1bcc2453df3f89445fc7b163316f] source b025e60b8d00b0d8fbb694285eafb2c95b7b129e
git bisect bad 969358ed4f1b1bcc2453df3f89445fc7b163316f
# good: [ab68bafb0a040e411b64fa40b5f25a4f43abd377] source 6536150492b8f59af3385afbab7792082f1b45dd
git bisect good ab68bafb0a040e411b64fa40b5f25a4f43abd377
# good: [6d8a0ce1d695dfb6d6ed98c864bfc7835fe496ca] source ff01ea8419db4b8ec81bd0d6edfc673d7140b4fd
git bisect good 6d8a0ce1d695dfb6d6ed98c864bfc7835fe496ca
# bad: [db6de0ca6db55e0290fb0ba55cc205025d07fbc9] source dc9d9ff650c135e9a9d84af3480d992c7b6d47e7
git bisect bad db6de0ca6db55e0290fb0ba55cc205025d07fbc9
# bad: [5bb3328446b430a8ef1215fc591c4b1ed6312e9c] source aef1e2dde5e53ba8416a393bbe155ef0c18511a7
git bisect bad 5bb3328446b430a8ef1215fc591c4b1ed6312e9c
# good: [17ef29ca40e3bc6b38bd4658537f58b36af8e1d0] source c2b488e5dfa5defb87a6e8392749a9276c3a950f
git bisect good 17ef29ca40e3bc6b38bd4658537f58b36af8e1d0
# first bad commit: [5bb3328446b430a8ef1215fc591c4b1ed6312e9c] source aef1e2dde5e53ba8416a393bbe155ef0c18511a7
Comment 3 Troy Rollo 2017-06-05 06:26:13 UTC

*** This bug has been marked as a duplicate of bug 82802 ***
Comment 4 Troy Rollo 2017-06-05 06:29:57 UTC
There is currently no code on the master branch for saving or loading conditional paragraph style information, for any file format.
Comment 5 Troy Rollo 2017-06-05 09:31:17 UTC
Created attachment 133859 [details]
Patch for master branch

Fix for master branch attached
Comment 6 Xisco Faulí 2017-06-05 09:41:33 UTC
Hi Troy,
Thanks for the fix. Please submit the patch to gerrit as described here: https://wiki.documentfoundation.org/Development/gerrit/SubmitPatch
Regards
Comment 7 Commit Notification 2017-06-13 16:55:53 UTC
Troy Rollo committed a patch related to this issue.
It has been pushed to "master":

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

tdf#103091 conditional style conditions not saved

It will be available in 6.0.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 Commit Notification 2017-06-13 22:25:27 UTC
Troy Rollo committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e9869b9b38d4e4e7f893aecb26f73d985f17e350&h=libreoffice-5-3

tdf#103091 conditional style conditions not saved

It will be available in 5.3.5.

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 9 Commit Notification 2017-06-14 08:36:37 UTC
Troy Rollo committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5649def882dfd00bd9e7f8d9d079955daf80bebb&h=libreoffice-5-4

tdf#103091 conditional style conditions not saved

It will be available in 5.4.0.1.

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 Michael Stahl (allotropia) 2017-06-14 10:05:06 UTC
thanks Troy for finding and fixing the bug!

it would have been really helpful for a prompt resolution if this bug report had
mentioned the magic word "ODF" somewhere, or maybe the "dataLoss" keyword.

this is a regression from:

commit aef1e2dde5e53ba8416a393bbe155ef0c18511a7
Author:     Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
AuthorDate: Mon Dec 21 03:55:14 2015 +0100

    move SwXStyle entirely into compilation unit
 

... which made the export code depend on a new ICoreParagraphStyle
interface, but forgot to implement it anywhere, and ...


commit da870b35dd0cf8b7a987530e896b3e044f444908
Author:     Noel Grandin <noel@peralex.com>
AuthorDate: Mon Sep 26 13:01:42 2016 +0200

    remove unused ICoreParagraphStyle


... which removed the export code because there was no way it was used.
Comment 11 Commit Notification 2017-06-15 13:40:28 UTC
Troy Rollo committed a patch related to this issue.
It has been pushed to "libreoffice-5-3-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6a53a750e48c8a7b6ea6bf263eae80179374016e&h=libreoffice-5-3-4

tdf#103091 conditional style conditions not saved

It will be available in 5.3.4.

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 12 Commit Notification 2017-06-15 21:29:47 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#103091 sw: add unit test for conditional style import/export

It will be available in 6.0.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 13 Kaue 2018-10-23 21:01:43 UTC
The procedure described now works, but conditions set in the "Text body" style are still not working (they disappear after reloading the document) on 6.1.1.2 (x64, Windows 10).
Comment 14 Troy Rollo 2018-11-15 10:38:16 UTC
I could see why that might be the correct behaviour. "Text Body", conceptually, is intended to be just unadorned body paragraphs, so it should not have any conditional styles. Anything which causes the appearance to change does so because it is no longer text body. Of course if that is the reason for the behaviour you are observing, then LibreOffice should not offer the user interface to set it.

You should open this as a new report. It will need to be reviewed by the LibreOffice team to identify what the correct behaviour is, and that will determine which way it gets fixed.