Apache OpenOffice (AOO) Bugzilla – Issue 112378
number:date-style and number:time-style are sometimes ignored
Last modified: 2017-05-20 10:02:07 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?
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.
@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.
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.
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.
Please attach example.
No info from author.