Bug Hunting Session
Bug 43467 - axis number FORMATTING not taken automatically from cells with calculated value
Summary: axis number FORMATTING not taken automatically from cells with calculated value
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
3.4.0 release
Hardware: Other All
: medium major
Assignee: Kohei Yoshida
URL:
Whiteboard: target:3.5
Keywords: regression
Depends on:
Blocks:
 
Reported: 2011-12-02 05:35 UTC by Michael Meeks
Modified: 2011-12-09 21:57 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
sample file (19.23 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-12-02 05:35 UTC, Michael Meeks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2011-12-02 05:35:06 UTC
I didn't expect the attached (seems to show two bugs - sorry about that).

The not taking the date format from the source is the one I originally fell over, it works fine until you copy the area with formulae (as I did), and then it oddly falls down (it seems).
Comment 1 Michael Meeks 2011-12-02 05:35:36 UTC
Created attachment 54073 [details]
sample file
Comment 2 Rainer Bielefeld Retired 2011-12-03 00:33:01 UTC
[Reproducible] with reporter#s sample and own documents! 

Not a new Beta0 effect, I already see that problem with Server installation of Master "LibO-dev 3.5.0 – WIN7 Home Premium (64bit) English UI [(Build ID:  5d1a991-4cb1bac-ca7e6f5-9125509-ce71330)]" (111109) (picked haphazardly)
and
[Reproducible] with "LibreOffice 3.4.4  - WIN7 Home Premium (64bit) German UI [Build ID: OOO340m1 (Build:402)]"

[Reproducible] with some LibreOffice 3.4.2 RC OOO340m1 (Build:201) and
LibreOffice 3.4.1 RC OOO340m1 (Build:101)

Works fine with "LibreOffice Portable 3.3.3  - WIN7  Home Premium (64bit) German UI [OOO330m19 (Build:301  Tag 3.3.3.1)]", so it seems to be a 3.4 regression.

This problem occurs also for other chart types.

'Format -> Cell -> Date' for x-axis cells heals the problem as a workaround

@Michael:
I will file a new bug for the "modern art" problem, I doubt that it's related, although it came up with the same version

@Kohei:
I saw you active in an other axis number formatting bug. 

Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 3 Kohei Yoshida 2011-12-09 19:52:35 UTC
The reason it's not taking the data format from the source is that the source cell's format is set to Number - General.  So, the chart was doing the "right thing" by taking that format.

Now, Calc normally automatically sets the cell format to date when you enter a date value.  I have no idea why cells A7:A8 have Number - General format, but if I were to pick a bug from this scenario, I would say it was Calc not setting the date format to A7:A8.

Interestingly, retyping those date values into A7:A8, and refreshing the chart fixes the x-axis formatting problem.
Comment 4 Kohei Yoshida 2011-12-09 19:56:07 UTC
As for the odd stacked area chart issue, Rainer said he would file a separate bug for it.  So I'll skip that one in this bug report.
Comment 5 Kohei Yoshida 2011-12-09 20:01:07 UTC
(In reply to comment #3)

> Now, Calc normally automatically sets the cell format to date when you enter a
> date value.  I have no idea why cells A7:A8 have Number - General format, but
> if I were to pick a bug from this scenario, I would say it was Calc not setting
> the date format to A7:A8.

Ah, those values are formula results, and Calc doesn't change the format of formula cells since those are "implicit" format as opposed to "explicit" one.  Internally we keep two formats, one explicit and one implicit for formula cells.

So, the right thing to do here is, when the cells are formula cells, send the chart the implicit format as opposed to the explicit format.  That should solve this problem.

I'll take a look at this for 3.5.
Comment 6 Kohei Yoshida 2011-12-09 21:49:47 UTC
Fixed on master

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ef747a6570d72f3f2f871ee2edd4611523f91988

and cherry-picked to the libreoffice-3-5 branch.

This will be fixed in Beta2 (I guess?).
Comment 7 Kohei Yoshida 2011-12-09 21:57:26 UTC
I've filed Bug 43681 for the odd stacked area chart bug.