Bug 148922 - Allow to make non-conditional style conditional, and show Condition tab permanently
Summary: Allow to make non-conditional style conditional, and show Condition tab perma...
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:
Keywords:
Depends on:
Blocks: Writer-Styles-Paragraph
  Show dependency treegraph
 
Reported: 2022-05-04 09:10 UTC by Mike Kaganski
Modified: 2023-04-22 19:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-05-04 09:10:21 UTC
In bug 82802, conditional style was practically defined as having some conditions set (so removing all [context->style] mappings makes a previously conditional style not conditional). This also establishes that the style *can* change the "conditional" property during its lifetime, despite documentation claims otherwise [1] :

> Once defined, you cannot change the conditional properties of a conditional style.

The original issue with the mentioned bug 82802 was, though, the very fact that after you remove all mappings from a previously conditional style, you can't later add new mappings - so you can't convert a non-conditional style into conditional one.

I suggest to resolve *that* original problem simply by enabling the Condition tab permanently, not only for newly-created styles and styles already having conditions.

Regina: could you please confirm that from the ODF point of view, the equivalence between "style having context->style mappings" and "conditional style" is correct, i.e. that ODF doesn't allow to have a conditional style without at least one defined mapping? If ODF technically allows to have such "empty" conditional styles, then the solution to bug 82802 would need to be changed.

[1] https://help.libreoffice.org/7.3/en-US/text/swriter/01/05130100.html?DbPAR=WRITER
Comment 1 Regina Henschel 2022-05-04 15:19:39 UTC
(In reply to Mike Kaganski from comment #0)

> Regina: could you please confirm that from the ODF point of view, the
> equivalence between "style having context->style mappings" and "conditional
> style" is correct, i.e. that ODF doesn't allow to have a conditional style
> without at least one defined mapping?

The attributes 'style:condition' and 'style:apply-style-name' are mandatory for an <style:map> element.

A <style:style> element can have zero or more <style:map> child elements.

The technical term "conditional style" is defined in 16.3 ODF 1.3 as "A style that contains one or more mappings is called a conditional style." 

 If ODF technically allows to have such
> "empty" conditional styles, then the solution to bug 82802 would need to be
> changed.

If there is a tab "Condition" but the user has not set any condition, then no <style:map> element is written out. If the file markup has <style:map> elements, then the condition is shown in the "Condition" tab. If there are no <style:map> elements, then the "Condition" tab could show no conditions, same as when a new style is created. I see no reason why a "Condition" tab is not shown all the time.
That is a problem in the UI of LO, not a problem with file format.