Description: When I save a document which has conditional paragraph styles, they should be present when I open the document. Steps to Reproduce: 1. Open a new document with the default template 2. Set a conditional paragraph style for the paragraph style "Corps de Texte" (sorry, I'm using the french version and it doesn't allow me to switch to English for the UI) mapping the context "1er niveau de numérotation" to the style "Numérotation 1". 3. Save the file. 4. Leave Writer. 5. Launch Writer and reload the file. Actual Results: The conditional paragraph style has disappeared. Expected Results: The conditional style should still be present. (If the issue is that the file format .odt doesn't allow to represent conditional style, there should be a warning somewhere stating which format should be used to save it correctly). Reproducible: Always User Profile Reset: No Additional Info: I've reproduced the issue on both Windows with LibreOffice 7.0.1.2 and on Linux with LibreOffice in an up to date Ubuntu 20.04 (6.4.X if I'm not mistaken).
I can't confirm it with Version: 7.0.1.2 (x64) Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452 CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: threaded
@Dieter, did you try with the default style "Text Body" which is presented in the french version as "Corps de texte"? If I create a new paragraph style, I can save and reload the conditional paragraph style, if I try to set conditional paragraph information for "Text Body", I can't.
(In reply to Jean-Marc Bourguet from comment #2) > @Dieter, did you try with the default style "Text Body" Yes.
Thank you for reporting the bug. To be certain the reported issue is not related to corruption in the user profile, could you please reset your Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and re-test? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the issue is still present
(In reply to Xisco Faulí from comment #4) > Thank you for reporting the bug. To be certain the reported issue is not > related to corruption in the user profile, could you please reset your > Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and > re-test? > > I have set the bug's status to 'NEEDINFO'. Please change it back to > 'UNCONFIRMED' if the issue is still present I can confirm that I still reproduce the issue with the profile reset. Yours
Conditional styles in Writer is new to me. I found it when editing the paragraph style - a Condition tab is there (already since at least LO 3.5!). If, with a new/clean user profile, I open LibreOffice and set the paragraph style filter to only show "Conditional" styles, I already see Text Body. When I modify that paragraph style, the checkbox for "Conditional Style" is checked, but disabled. (And that seems true for any style that enables "conditional styles".) As OP says - in there you have to map a Context with a style - and then press "Apply" to create the mapping. (What effect it has I don't know because I couldn't see any change in my document under those contexts...) So - in the end I confirm what OP says. The mapping is still there in a new style that I create, but in "Text Body", any mapping is lost. (I notice that no other built-in styles have the option to set a conditional style.) It worked up until LO 5.2. Unfortunately, I don't yet have the per-commit bibisect for 5.2, so the problem started in the range https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=125cdf3404e60cf78f2a5547e9a06ce994df5c8e..7041701edc6274eaa9df4dae970452131f76e433 Not yet calling this a regression, because I don't know if TextBody should be allowed to have a conditional state.
Conditional styles have been there since 2000 - initial import. For some reason, text body really is supposed to be conditional. bool IsConditionalByPoolId(sal_uInt16 nId) { // TODO: why is this style conditional? // If it is changed to no longer be conditional, then a style "Text Body" // will be imported without its conditions from ODF. return RES_POOLCOLL_TEXT == nId; } Since this has been broken since 2015 with no complaints except people who get confused, should we just get rid of this exception to the rule completely? *** This bug has been marked as a duplicate of bug 82802 ***
(In reply to Justin L from comment #7) > Conditional styles have been there since 2000 - initial import. > > For some reason, text body really is supposed to be conditional. See https://help.libreoffice.org/7.2/en-US/text/swriter/01/05130100.html?DbPAR=WRITER#bm_id3154656 <quote> Tip Icon The "Text Body" Style was created as a conditional style. Therefore, any styles you derive from it can be used as conditional styles. </quote>
(In reply to Regina Henschel from comment #8) > Therefore, any styles you derive from it can be used as conditional styles. That sounds like meaningless drivel to me. If I create a new style "derived" from the default style, I also have a condition tab available. Obsolete information?
The intention is to have a predefined style as conditional style, even if the condition is empty. So you can define an own conditional style, which fits in nicely into the "Text Body" hierarchy. That makes it easier for users. And I don't know, in which way conditional style is used in macros. So the information is not obsolete, but the feature has to be repaired.
(In reply to Justin L from comment #6) > I don't yet have the per-commit bibisect for 5.2. I finally got this downloaded although it needs two OSes to run it. The bad section only works on 20.04, and 16.04 can use that bad part that 20.04 runs. Anyway, the first bad result appears to be from Bjoern Michaelsen on 13:15:27 commit aef1e2dde5e53ba8416a393bbe155ef0c18511a7 move SwXStyle entirely into compilation unit
This commit is entirely beyond my comprehension. My guess is it has to do with ICoreParagraphStyle - which appears to have been forgotten to be added to SwXPageStyle? ICoreParagraphStyle as removed by commit da870b35dd0cf8b7a987530e896b3e044f444908 Author: Noel Grandin on Mon Sep 26 13:01:42 2016 +0200 remove unused ICoreParagraphStyle It was added back in with commit a5b4cb3f836c991d0647f55e1ef4920ce6115eac Author: Troy Rollo on Tue Jun 6 17:41:33 2017 +1000 tdf#103091 conditional style conditions not saved Yet despite the incomprehensibility of this all, I might have the solution. It looks like the only problem is that Troy added the requirement for xNewStyle. Using GetStyle() instead solves the problem.