Download it now!
Bug 78294 - FILEOPEN: Date off by 4 years if .ods is loaded with 1904 date being effective in settings
Summary: FILEOPEN: Date off by 4 years if .ods is loaded with 1904 date being effectiv...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: high critical
Assignee: Eike Rathke
URL:
Whiteboard: target:4.3.0 target:4.2.5
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-05 11:20 UTC by Eike Rathke
Modified: 2014-05-05 20:15 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Rathke 2014-05-05 11:20:27 UTC
1. create new spreadsheet document
2. make sure Tools->Options->Calc->Calculate Date is 1899-12-30
3. enter date 1977-11-11
4. save as 1899.ods
5. close document
6. create new spreadsheet document
7. set Tools->Options->Calc->Calculate Date to 1904-01-01
8. enter date 1977-11-11
9. save as 1904.ods
10. close document
11. open 1899.ods
12. see date is now 1973-11-10
13. don't forget to create a new spreadsheet document and set Tools->Options->Calc->Calculate Date to 1899-12-30 again and save, otherwise the setting persists for further documents..
14. the error of loading 1899.ods vanishes after having set and saved the value 1899-12-30 once

Explanation: 1899.ods does not contain a <table:null-date> value, which according to ODF means to use the default 1899-12-30 null-date but apparently we use the then in effect option settings' null-date (1904-01-01) instead in this case, despite that the settings after having loaded the document says 1899-12-30. Note that 1904.ods does contain the null-date 1904-01-01 and things work correctly regardless of the previous null-date set in Tools-Options.
Comment 1 Commit Notification 2014-05-05 17:29:00 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

resolved fdo#78294 default null-date for document import is 1899-12-30



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 2 Eike Rathke 2014-05-05 18:06:36 UTC
Pending review for 4-2 at https://gerrit.libreoffice.org/9253
Comment 3 Commit Notification 2014-05-05 20:15:17 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3efb6e5c35bb1129a78726b163f8fbf9bd94734a&h=libreoffice-4-2

resolved fdo#78294 default null-date for document import is 1899-12-30


It will be available in LibreOffice 4.2.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.