If current cell is formatted to only show negatives using color, without minus sign, then the format is used to display status bar functions (sum, average, ...), but does not use colors, which is confusing.
1. Put -1 to A1, -2 to A2
2. Format A2 to use "0;[RED]0" format string.
Now if you select A2, status bar would show sum as 2; if you select A2 and A1 *starting from A2* (so that thick border marks A2), sum shown as 3 (but if you select them starting from A1, sum is shown a -3).
The problem is that color information is discarded in ScTabViewShell::GetFunction; if we could store the color in the resulting string somehow, then we could use it in SvxPosSizeStatusBarControl::Paint; in that case, we would still need to use undecorated string in SvxPosSizeStatusBarControl::StateChanged when setting item text used in tooltips.
Nominating as easy hack; Eike: could you please also look at it if this is reasonable?
reproducible Version: 22.214.171.124.alpha0+
Build ID: ea59fc4831b9d2430de51faa8c3e0a24e6d90cd1
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
Also reproduced in
Transporting colour to display in status bar IMHO would be overkill. Solution probably would be to not use the actually applied format, but the format's locale's category's default format instead. Of course not for currencies..
Suitable as EasyHack, code pointer:
place calling pDoc->GetNumberFormat(...)
Add something calling SvNumberFormatter::GetStandardFormat( double, sal_uInt32, SvNumFormatType, LanguageType)
I am interested to work on this bug with two coworkers of mine, so I am assigning this to me. We will try to solve this, following the proposing instructions from Eike Rathke.
I am not sure actually this is really a bug. The sum is being displayed correctly but according to the format of the first cell you select.
So for the example of Mike Kaganski:
If you select A2 and then A1 the sum is 3 because of the "0;[RED]0" format (which displays negative numbers without the "-").
If you select A1 and then A2 the sum is -3 displayed with the standard format of A1.
I checked the same example using Excel and it has the exact same results.
So I think we should recosinder if this is a bug or not.
(In reply to Eleni Zapridou from comment #5)
This is not a bug per se, and it was never stated otherwise. Even the title has "wrong" in quotes.
Still, there's a usability issue. The status bar is incapable of displaying the formatted value using all the features which cells can use - like colors in format strings, or conditional formatting that might change background for negatives e.g. Also users could custom-format cells to look like sort of booleans to indicate if something matches some conditions or not (like '[<10]"GOOD";[<20]"WARNING";"BAD"')... and it totally doesn't make sense to have such things in status bar for aggregates, when for a sum of cells, you'd see "BAD" in status instead of "100" - what is "BAD" for a data point is not necessarily bad for the sum.
So there is a suggestion by Eike in comment 3, which is to use *cell format category's default format* for displaying aggregates in the status bar, which are expected to be generic enough to provide useful aggregate results, even when selection has some fancy formatting.