Bug 39122 - Calc trashes colour codes in user-defined number formats
Summary: Calc trashes colour codes in user-defined number formats
Status: CLOSED DUPLICATE of bug 37658
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.4.1 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
Whiteboard: numberformat
Depends on:
Reported: 2011-07-10 16:24 UTC by Matt
Modified: 2012-02-16 07:31 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

Simple spreadsheet with conditional colours (10.03 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-07-28 14:28 UTC, Matt

Note You need to log in before you can comment on or make changes to this bug.
Description Matt 2011-07-10 16:24:05 UTC
Calc removes the colours from user-defined number format definitions, even in an existing spreadsheet that previously worked. In some cases, the colours disappear from the sheet, in other cases they remain but the format definition no longer shows them.

Steps to reproduce:
1) Open a spreadsheet containing cells with the following user-defined number format (or similar), or attempt to create this user-defined format:


2) Select Format Cells|Numbers

Actual results:
LibO 3.4 replaces this format with the following:


The colour information is missing from the format definition. The colours may remain, but if the sheet previously contained this format working, the colours are all gone.

Expected results:
Previous versions of LibO and OOo treated this format code correctly, and the code was available for editing in the User-defined section of the number formats list.

Build: LibreOffice 3.4.1 OOO340m1 (Build:103)
System: Windows 7 64-bit
Comment 1 Matt 2011-07-10 16:42:25 UTC
If the format given above is applied to some cells, and then the user wishes to apply the same format to a further range of cells, as the format in the user-defined list no-longer contains the colour information, the colours do not appear. However the behaviour seems to differ in a new document, so the fault may only partly replicate if a new document is created to test it: the colour codes are then lost from the Format code, but the colours may still appear. If the colours will appear in the document, colours are also still shown in the illustration box in the Format Cells dialogue. The problem did not exist in LibO 3.3 and previous.
Comment 2 Matt 2011-07-24 15:53:41 UTC
I went through a large document rewriting all the format codes with the one I gave at (1). Now I have reloaded the document, all the colours are gone, and LibO has replaced the colour code with the one at (2). I could tick the box for "Negative numbers in red", but then I lose the "+" in front of the numbers. As soon as I enter any user-defined formatting, the "Negative numbers in red" greys out, but user-defined colours are removed from the format in the list, and no-longer work in the cells where they were applied next time the document is loaded.
Comment 3 Matt 2011-07-28 14:28:41 UTC
Created attachment 49690 [details]
Simple spreadsheet with conditional colours

This ODS file was created in LibreOffice 3.4.1 OOO340m1 (Build:103) in Win7 64-bit OS.  Cells B1:B20 had the User-defined number format entered as:

[BLUE][<0]#,0 "°C";[RED][>30]#,0 "°C";[BLACK]#,0 "°C"

which was pasted directly from the LibO online help page:


The colours displayed correctly as follows: B1:B4 in BLUE, B5:B8 in BLACK, B9:B20 in RED.

The file was saved, closed and reopened. The format codes for B1:B20 now show as

[<0]#,##0" °C";[>30]#,##0" °C";#,##0" °C"

and all numbers appear in black.

This behaviour was not present in LibO 3.3 or OOo.
Comment 4 vitriol 2011-07-28 14:41:19 UTC

*** This bug has been marked as a duplicate of bug 37658 ***