Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 653930 Details for
Bug 881523
xls2csv misinterprets the DATEMODE chunk
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to fix the problem
xls2csv-datemode.patch (text/plain), 2.07 KB, created by
Msquared
on 2012-11-29 03:00:59 UTC
(
hide
)
Description:
Patch to fix the problem
Filename:
MIME Type:
Creator:
Msquared
Created:
2012-11-29 03:00:59 UTC
Size:
2.07 KB
patch
obsolete
>diff -urN catdoc-0.94.2.orig/src/xlsparse.c catdoc-0.94.2/src/xlsparse.c >--- catdoc-0.94.2.orig/src/xlsparse.c 2006-02-25 01:44:06.000000000 +0800 >+++ catdoc-0.94.2/src/xlsparse.c 2011-01-11 10:09:59.000000000 +0800 >@@ -25,7 +25,7 @@ > char *forced_date_format = NULL; > size_t formatTableIndex = 0; > size_t formatTableSize = 0; >-double date_shift = 25569.0; >+double date_shift = DATEOFFSET_MS1900; > #define FLT_FORMAT(a,b,c) a #b c > #define MK_FORMAT(x) FLT_FORMAT("%.",x,"g") > char number_format[8]=MK_FORMAT(DBL_DIG); >@@ -37,7 +37,7 @@ > long reclen,build_year=0,build_rel=0,offset=0; > int eof_flag=0; > int itemsread=1; >- date_shift=25569.0; /* Windows 1900 date system */ >+ date_shift=DATEOFFSET_MS1900; /* Windows 1900 date system */ > CleanUpFormatIdxUsed(); > while (itemsread) { > catdoc_read(rec,2,1,input); >@@ -384,8 +384,24 @@ > formatTable[formatTableIndex++] = formatIndex; > break; > } >- case MS1904: /* Macintosh 1904 date system */ >- date_shift=24107.0; >+ case DATEMODE: /* date base (formerly known as 'MS1904') */ >+ /* see section 5.28 (pp154) of http://sc.openoffice.org/excelfileformat.pdf */ >+ if ( reclen<2 ) { >+ perror("DATEMODE record should be at least two bytes long"); >+ exit(1); >+ } >+ switch ( getshort(rec,0) ) { >+ case DATEMODE_MS1900: >+ date_shift=DATEOFFSET_MS1900; >+ break; >+ case DATEMODE_MS1904: >+ date_shift=DATEOFFSET_MS1904; >+ break; >+ default: >+ // FIXME: should throw an error? >+ fprintf(stderr,"DATEMODE %02x %02x\n",(int)rec[0],(int)rec[1]); >+ break; >+ } > break; > > >diff -urN catdoc-0.94.2.orig/src/xltypes.h catdoc-0.94.2/src/xltypes.h >--- catdoc-0.94.2.orig/src/xltypes.h 2006-02-25 01:44:06.000000000 +0800 >+++ catdoc-0.94.2/src/xltypes.h 2011-01-11 09:40:50.000000000 +0800 >@@ -12,7 +12,11 @@ > > #define DATE_FORMAT 14 > >-#define MS1904 0x22 >+#define DATEMODE 0x22 >+#define DATEMODE_MS1900 0x0000 >+#define DATEOFFSET_MS1900 25569.0 >+#define DATEMODE_MS1904 0x0001 >+#define DATEOFFSET_MS1904 24107.0 > #define ADDIN 0x87 > #define ADDMENU 0xC2 > #define ARRAY 0x221
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 881523
: 653930 |
653931