Apache OpenOffice (AOO) Bugzilla – Issue 19494
Date format not saved
Last modified: 2017-05-20 11:25:46 UTC
To reproduce, Insert -> Fields -> Other Type Select Format DATE DATE(fixed) 1999-12-31 Save, close and reopen document Date format is now 9/12/03 though it was inserted as 2003-09-12 before Greetings, Jarek
i followed your steps but i can't reproduce this issue reassigned to jw
set to WFM as long as not reproduced eiter by you on a nother mashine or by someone else
This problem seems related to the selection of locale. The formated date comes back correctly when I choose another locale (I've tried English (United States), Danish and Finnish). When I switch back to my own locale, namely Swedish, the date format is wrong. I'll try to see if I can reproduce it on some other Windows OS at work. I've tried this on another W2000 machine (Dual P4) with the same result. /jarek
FWIW, I've tried this on WinXP too with the same result, i.e. that the format is not correctly recovered after save when the locate setting is Swedish and is allright for the English and most other locales. /jarek
hi jarek, can you tell me what OOo local version you have installed? maybe with a link to the location you downloaded it from!
> can you tell me what OOo local version you have installed? > maybe with a link to the location you downloaded it from! It's the english version. Most probably downloaded from http://ftp.sunet.se/pub/Office/OpenOffice.org/stable/1.1rc4/OOo_1.1rc4_Win32Intel_install.zip which is where I usually download from. /jarek
could reproduce this. it just occurs on some date formats when swedish locals are set in the office options date format "Wednesday, September 17, 2003" would be saved and is still set after closing and reopening the document date format "2003-09-17" changed to "9/17/03" after closing and reopen the document. reassigned to mib please take a look at this issue. set target to OOo2.0
utomo> jw : change to new ?
The date format is stored correctly in the file, but when loading file, it is not assgined to the field agin.
.
MIB->ER: The date format exported correctly. It is also imported, but when it is added to the number formater using GetEntryKey, the wrong format id (30 rather than 84 if locale is german) is returned. GetEntryKey is called from SvXMLNumFormatContext::CreateAndInsert in xmloff/source/style/xmlnumfi.cxx
seems like mib assigned this to wrong person.
This seems to be a Writer problem. It occurs only if, upon creating the document, the locale is set to Swedish-Sweden but the current document language is set to English-US, for example. It does not occur if the document language is also set to Swedish. One part of the problem seems to be that the sv_SE default date format is yyyy-mm-dd, and the number format used for the date field is not remembered to be an en_US format, so when loading it results in "this is default" which then is merged with the en_US default date format , instead of an sv_SE one. The issue also does not occur when the format's language is explicitly set to English-US instead of Automatic in the "Additional formats" dialog. Since I don't know how the Writer handles that language mix I pass this on to Oliver. Eike
I traced this issue with oliver together and we identified what causes the misbehavior. the file is saved in a correct manner, but during the document gets loaded again we receive different formats for different "locale" settings. see SwXTextField::attachToRange, case SW_SERVICE_FIELDTYPE_DATETIME, m_pProps->nFormat change for different locales.
after a short discussion back to you ;-)
As long as the number format is automatically applied at the field the conversion of the XML representation to the formatting of the internal number formatter is not lossless. This can be prevented by saving the number format togehter with the language attribute and store the 'automatic' mode in an additonal flag. As user the problem can be worked around by assigning a language to the number format in the 'Additional formats...' dialog Retarget to later
Note that (even with suggested workaround of specifying date format) if document is saved as ms word (.doc) and opened in ms word - date is ok. If the same .doc is opened by writer - date is changed (in my case to created->author). This problem is still on in OO 2.3.0.
Reset assigne to the default "issues@openoffice.apache.org".