Bug 153812 - [SAVE] Custom Number Format in Calc is not Retained
Summary: [SAVE] Custom Number Format in Calc is not Retained
Status: RESOLVED DUPLICATE of bug 146404
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-24 18:35 UTC by Michael Howard
Modified: 2023-03-20 16:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Howard 2023-02-24 18:35:53 UTC
Custom Number Formatting (user defined) in a CALC spreadsheet such as:-

[GREEN][$£-809]#,##0.00;[RED]-[$£-809]#,##0.00

which formats positive numbers as GREEN or negative numbers as RED works fine.

It is possible to use more than the standard colours using COLORX e.g.

[COLOUR22][$£-809]#,##0.00;[RED]-[$£-809]#,##0.00

This colours positive numbers in this case as DARK GREEN and this is displayed in the spreadsheet when applied.
However when the spreadsheet (ODF) is saved, this formatting is not displayed and the custom format is lost.
Comment 1 Michael Howard 2023-02-24 18:38:46 UTC
Should read COLOR22 not COLOUR22 English spelling used in error report by mistake:-

[COLOR22][$£-809]#,##0.00;[RED]-[$£-809]#,##0.00
Comment 2 m_a_riosv 2023-02-24 22:01:36 UTC
In https://help.libreoffice.org/7.6/en-US/text/shared/01/05020301.html?&DbPAR=CALC&System=WIN
"
Color
To set the color of a section of a number format code, insert one of the following color names in square brackets [ ]:

CYAN,GREEN,BLACK,BLUE,MAGENTA,RED,WHITE,YELLOW
"

No other colors than that are accepted.
The format code
[COLOUR22][$£-809]#,##0.00;[RED]-[$£-809]#,##0.00
it is not accepted at all, when you enter it, push Ok, edit again the cell format, 'Standard' there.

The first format, it's accepted and saved.

Tested with:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ab20dba30769a5a52830220daa347772485db6a2
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded Jumbo

To me, not a bug.
Please if you are not agree, reopen it.
Comment 3 ady 2023-02-25 01:01:32 UTC
This "has" to be a bug (or more than one). Please keep reading.

Using the American English spelling:

1. A1: [CTRL]+[1]
2. [COLOR22][$£-809]#,##0.00;[RED]-[$£-809]#,##0.00   (OK)
3. A1: 1  [ENTER]

You can clearly see that the color format is accepted.

4. Save; you can still see the color.
5. Close the file and reopen it. > The color is gone and the [COLOR22] format in A1 is gone too.

This happens for .ods and for .xls(x).

I don't know whether the ODF specs actually accept this in some form or another.

But, since Calc seems to initially accept the format, the this seems to be:

A_ A saving problem (ods).
B_ An export problem (xls and xlsx).
C_ Lacks proper documentation?

CC'ing Laurent Balland (who recently added some other custom number format support).
Comment 4 m_a_riosv 2023-02-25 02:30:37 UTC
I was having problems with the mix between comma and decimal point.
I can reproduce now.
But this is a duplicate of tdf#146404

*** This bug has been marked as a duplicate of bug 146404 ***
Comment 5 Michael Howard 2023-03-20 16:57:28 UTC
As the submitter of this error, I wish to explain why this was an issue for me.
The reason I wanted to change the colour from the documented green is that the shade of green in the standard [GREEN] is quite light and is difficult to read against a white default background, hence I wanted to display a slightly darker shade [COLOR23] which is much more readable.