Summary: | Status bar displays "wrong" sum when colored negative cell format used | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Mike Kaganski <mikekaganski> |
Component: | Calc | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | erack, ezapridou, mentoring, raal, xiscofauli |
Priority: | medium | Keywords: | easyHack, skillCpp |
Version: | Inherited From OOo | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | reviewed:2023 | ||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 86066 |
Description
Mike Kaganski
2018-08-13 12:23:03 UTC
reproducible Version: 6.2.0.0.alpha0+ Build ID: ea59fc4831b9d2430de51faa8c3e0a24e6d90cd1 CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3; Also reproduced in LibreOffice 3.3.0 OOO330m19 (Build:6) tag libreoffice-3.3.0.4 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: sc/source/ui/view/tabvwsha.cxx ScTabViewShell::GetFunction() 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. |