Issue 112378 - number:date-style and number:time-style are sometimes ignored
Summary: number:date-style and number:time-style are sometimes ignored
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: General
Classification: Code
Component: chart (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC (x86_64) All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2010-06-14 12:46 UTC by hardcoder
Modified: 2017-05-20 10:02 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description hardcoder 2010-06-14 12:46:48 UTC
It has taken me a very long time to find an envelope for the following behavior.

I have some charts that are being generated programmatically and added to an
existing file. Basically I create a chart, some data, and a few styles, and
stick them into the document tree at a reasonable point. This works fine until I
start trying to apply time/date formatting to values on my X axis.

I find that I'm able to use a style like this:
<number:date-style style:name="N2"><number:month
number:style="long"/><number:text>/</number:text><number:day
number:style="long"/><number:text>/</number:text><number:year
number:style="long"/></number:date-style>

But if replace the second '/' with, say, '-':
<number:date-style style:name="N2"><number:month
number:style="long"/><number:text>/</number:text><number:day
number:style="long"/><number:text>-</number:text><number:year
number:style="long"/></number:date-style>

then when my document opens and the chart is rendered, the dates show up as
floating point numbers with no formatting.

I can use the chart editor to change the format for the X axis to what I should
be seeing and then save the document. OO writes it out in the canonical form,
separating the chart out into an embedded object. The automatic style is exactly
the same:

<number:date-style style:name="N116">
<number:month number:style="long"/>
<number:text>/</number:text>
<number:day number:style="long"/>
<number:text>-</number:text>
<number:year number:style="long"/>

And when I open the document, the formatting works just fine.

It appears to me that in the circumstances I have, OO only accepts a small
number of formats and rejects everything else, despite the XML being perfectly
reasonable ODF and being the same as what OO writes out and parses correctly in
its canonical format. HH:MM:SS works, HH:MM works, MM/DD/YYYY works; any
variation seems to be ignored. (More may work -- I don't know. I just figured
this out.)

What's going on here? Have I missed something? Is there a workaround that
doesn't involve creating embedded objects? (That's not necessarily a big deal
for me, but it is more work.) Why does this not work as it seems it should?
Comment 1 hardcoder 2010-06-14 12:48:49 UTC
Note: In the example above the line breaks in the first two samples of XML are
Bugzilla's doing. The actual XML strings I'm using have no line breaks. The
third example is pasted from Firefox.
Comment 2 IngridvdM 2010-07-02 17:36:50 UTC
@hardcoder, what do you see when double clicking on the chart after loading the
manipulated file?
The charts are displayed as metafile replacements initially. So if you do not
trigger a repaint after loading you will see simply the same image that was
there when saving.
Comment 3 hardcoder 2010-07-03 00:31:11 UTC
These are files that contain charts that I have generated ad hoc (with perl
programs), so they were never saved to begin with and there was no replacement
graphic.

I've since started using embedded/contained objects and I can generate date/time
formats of arbitrary variety just fine. However, when I filed this bug I was
using a presentation object (odp) that incorporated the chart object DIRECTLY
into its top level content.xml file. This is the case that doesn't work
properly, where OO is refusing to recognize all but a very limited number of
time/date formats.
Comment 4 Rob Weir 2013-02-02 02:56:52 UTC
This Issue requires more information ('needmoreinfo'), but has not been updated
within the last year. Please provide feedback as requested and re-test with the the latest version of OpenOffice - the problem(s) may already be addressed. 

You can download Apache OpenOffice 3.4.1 from http://www.openoffice.org/download

Please report back the outcome of your testing, so this Issue may be closed or
progressed as necessary - otherwise the issue may be Resolved as Invalid in the
future.
Comment 5 Edwin Sharp 2014-03-02 14:55:01 UTC
Please attach example.
Comment 6 Edwin Sharp 2014-03-15 16:18:43 UTC
No info from author.