https://bugs.documentfoundation.org/show_bug.cgi?id=147535

            Bug ID: 147535
           Summary: The cell style "Applied styles" listing in the Styles
                    side panel is misleading
           Product: LibreOffice
           Version: 6.4 all versions
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
The way cell styles usage detection is reported in the Calc Styles side panel
(BTW also by the style .isInUse API property) may lead the user to delete
actually useful styles, breaking the spreadsheet look.

Styles side panel -> Cell styles -> Applied styles

In Calc, a cell style is currently reported as used when it is used for itself
in any cell formatting.

In fact, a cell style should be reported as used in all of the following
situations:
1. when it is actually used per itself in any cell of the spreadsheet (current
situation)
2. when it is actually used in a conditional format (the CF being applied or
not is of NO importance)
3. and 1. and 2., recursively to their heirs, direct or not.


This means that currently a user might erroneously consider a custom style as
not used -- thus removing it -- while the style or a child of his' is actually
used in the spreadsheet. 

This would potentially cause havoc to the formatting, since:
-- the cell styles inheritance tree might be unknown to the current user
-- some conditional formattings might not be visible at the time of the
(inappropriate) style removal.

Remember that a user is not necessarily the person who originally designed the
spreadsheet, hence s-he might overlook such "details".

Side note: in Writer, the paragraphs styles inheritance tree is respected. An
unused parent style is listed as Applied whenever one of its heirs is actually
used.

Steps to Reproduce:
0. Open a new spreadsheet document.
1. Create a cell style, say "MyParent", descending from Default. 
Set it to whatever you want, say "14pt font.
Make sure to not have any cell with that style applied.
2. Create a cell style "MyChild", descending from MyParent.
Set it to whatever you want, say white font on black background.
Apply this style to cell Sheet0.A1.
3. Create a cell style "MyCF", descending from MyParent.
Set it to whatever you want, say white font on red background.
4. Select Sheet0.B1 and create a conditional format with:
Value = 10 ; style = CF 
Check this by entering 10 in Sheet0.B1.
5. Go to the Styles side panel, cell style, Applied styles. MyParent is not
present, while its children MyChild and MyCF are actually used.

Actual Results:
A parent cell style is not considered as used when one of his heirs is actually
used.
A cell style is not considered as used when it is used for conditional
formatting only.
A parent cell style is not considered as used when one of his heirs is used for
conditional formatting only.

Expected Results:
Cell styles should be reported as used when:
-- they are used in some cell formatting
-- they are not used in some cell formatting, but:
   * one of their heirs is actually used for cell formatting.
   * they are used in some conditional formatting only.
   * one of their heirs is actually used for conditional formatting onyl.


Reproducible: Always


User Profile Reset: No



Additional Info:
(none)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to