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

--- Comment #9 from ClĂ©ment FOYER <[email protected]> ---
I experience a related issue on Debian, with conditional formatting with the
clause "is duplicate".

On Calc, I have a sheet where I wanted to use CF to visually notify when I have
a duplicate entry. So on my sheet, all the (relevant) cells share the set of
possible values, and in each column I do not want any duplicate.

I create several "if is duplicated then format as Bad" (one per column), and it
worked well. However, if I duplicate the sheet, or the duplicated sheet the
formatting rules are all merged in a single one with all the domains (i.e., all
the columns) merged. This results in not having any duplicate at all instead of
not having duplicate per column. Similarly, but I'm not sure when, either when
I saved and loaded or when I added more CF rules, I ended up losing the per
column rules in the original sheet as it got all merged in a single "if is
duplicate".

The steps to replicate are very easy :
1. create new document
2. add "is duplicate" rule to domain a1:a10
3. add "is duplicate" rule to domain b1:b10
4. duplicate the sheet
5. in the new sheet, the domains are merged

I think, contrary to what is proposed by the original bug reporter, the issue
is deeper than just asking for a merging button in the UI, but can be also
addressed more quickly.

Not all rules are to be evaluated in the same way. For most of the rules, the
evaluation only depends on the cell's value and the domain only specify which
cells are to be considered. For "is duplicate" and "is not duplicate", the
domain is also considered when evaluating the rule, and therefore merging
domains is not possible without changing meaning of the rule. The issue is
similar when considering heatmaps or colour scales applied to a domain.

I believe the most elegant solution would be to add a boolean to the different
CF operations, which would specify if the domain only specifies where to apply
the rule (i.e., for rules where only the value of the cell matters), and where
the domain is also part of the evaluation of the CF (i.e., for "is duplicate",
"is not duplicate", "above/below avg", etc). In the former case, the merging is
not affecting the evaluation and can be kept. In the latter, the merging of
domains should be disabled because it actually is erroneous.

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

Reply via email to