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

            Bug ID: 113595
           Summary: STYLE(foo) inside some functions behaves strangely
           Product: LibreOffice
           Version: 5.4.1.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

Description:
STYLE(...) inside certain functions seems to be called when it should not, even
if the rest of the formula seems to work normally.

Steps to Reproduce:
1. Start a new spreadsheet
2. Pick a cell... any cell. Insert this formula: ="foo"&SWITCH(
0,0,3&STYLE("Neutral"),-1,5&STYLE("Bad"),+1,7&STYLE("Good"))
3. Recalculate (F9) a few times.

Actual Results:  
The cell's value is "foo30", toggling between "Bad" and "Good" (red and green)
styles.

Expected Results:
The cell shows "foo30" in "Neutral" style (yellow)


Reproducible: Always


User Profile Reset: No



Additional Info:
Without the first (unused) STYLE exactly the same happens. Without either 2nd
or 3rd "&STYLE", the cell toggles between the other one and "Neutral" instead.

If the first argument is 1 or -1, the value is picked from the correct branch,
and toggling is still between the last 2 styles.

First it looked like SWITCH function is broken, but it's something weirder.

The same happens if you replace SWITCH with CONCATENATE - correct output value,
STYLE toggles. But SWITCH is supposed to ignore wrong branches, thus there
should be no possibility of racing in GUI or anything like that.

This does not happen with IF:
="foo"&IF( 0=0,3&STYLE("Neutral"), 5&STYLE("Bad"))
The result: "foo30" painted yellow as expected.

Does not depend on whether OpenGL and jRE are enabled or not.
Version: 5.4.1.2
Build ID: 1:5.4.1-0ubuntu1
CPU threads: 2; OS: Linux 4.13; UI render: default; VCL: x11; 
Locale: en-US (en_US.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101
Firefox/56.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to