Bug 33814

Summary: Conditional Formatting does not work properly
Product: LibreOffice Reporter: Chris Peñalver <chris>
Component: CalcAssignee: Muthu <muthu.subramanian.karunanidhi>
Status: RESOLVED NOTABUG    
Severity: minor CC: detective.conan.1412
Priority: medium    
Version: 3.3.0 release   
Hardware: x86 (IA32)   
OS: Linux (All)   
URL: https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/631857
Whiteboard:
Crash report or crash signature: Regression By:

Description Chris Peñalver 2011-02-01 09:12:22 UTC
Downstream bug may be found at:
https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/631857

Open up fresh spreadsheet, highlight only A1 through A3, click Format -> Conditional Formatting... -> Condition 1 checkbox checked (was by default) -> Cell value in dropdown box -> equal to in dropdown box -> in field type A -> Cell Style dropdown box is Default (was Default by default) -> click New style... button -> in Cell Style window click Background tab -> click Green -> click OK button

*** Notice Cell Style drop downbox box for Condition 1 changed itself from Default to Untitled1

-> Click Condition 2 checkbox -> Cell value is in dropdown box -> equal to in dropdown box -> in field type B -> Cell Style dropdown box is Default (was Default by default) -> click New style... button -> in Cell Style window click Background tab -> click Yellow -> click OK button

*** Notice Cell Style drop downbox box for Condition 1 changed itself from Default to Untitled2

-> in Conditional Formatting window clicked OK button.

Cells in column A & B are not green & yellow respectively.

lsb_release -rd
Description: Ubuntu 10.10
Release: 10.10

apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.3.0-1maverick1
  Candidate: 1:3.3.0-1maverick1
  Version table:
 *** 1:3.3.0-1maverick1 0
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ maverick/main i386 Packages
        100 /var/lib/dpkg/status
Comment 1 Muthu 2011-02-04 08:30:31 UTC
Picking this bug.
Comment 2 Joe Smith 2011-02-10 15:21:45 UTC
I'm not sure this is a bug, if I understand the report.

The condition entered amounts to this:

Cell value | is equal to | A

The entry A in the text box is interpreted as a Calc expression, and so entering a bare character A will be interpreted as a range name: "a".

In instead you enter "A" and "B", with the double quotes,

Cell value | is equal to | "A"

then the conditional formatting works as expected.

Or, if you first define ranges named "a" and "b" and then follow the steps posted in the description, then the conditional formatting works as expected.

The only problem I can see here is that Calc does not warn the user about the undefined range names--or any other syntax problems--in the value expression.
Comment 3 Muthu 2011-04-12 08:50:51 UTC
Works fine in master now. Please reopen if the problem still persists.
Comment 4 Korrawit Pruegsanusak 2011-09-10 01:31:40 UTC
With regard to comment 2, this is NOTABUG. (If there is no known fix, please don't mark as FIXED)

In short, you should enter the condition as quoted text.
Comment 5 Chris Peñalver 2011-09-10 07:17:01 UTC
Joe Smith / Korrawit Pruegsanusak, thank you for tackling the rationale of this bug. Your both correct in suspecting this not being a bug, but not for the reasons you mentioned. According to: 
http://help.libreoffice.org/Calc/Applying_Conditional_Formatting

It clearly states:

"To Define the Conditions

    Select the cells to which you want to apply a conditional style."

So, the original problem of only selecting cells A1:A3, applying the desired Conditional Formatting, and expecting it to apply to columns A and B are invalid. I'll leave this marked RESOLVED NOTABUG, get back to original downstream reporter, and file a new, more accurate bug if required.