Bug 47479 - 'initialisation of record 0x205 left 1 bytes remaining still to be read', when BOOLEAN values in the spreadsheet
Summary: 'initialisation of record 0x205 left 1 bytes remaining still to be read', whe...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: Macintosh Linux
: P1 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-06 05:22 UTC by Vesa Akerman
Modified: 2009-07-06 13:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vesa Akerman 2009-07-06 05:22:38 UTC
Gives this error when creating new HSSFWorkbook.  The excel file was made with OpenOffice 3.0, and converted to Microsoft Excel 97/... format.
This error occurs ONLY WHEN THERE ARE BOOLEAN VALUES in the spreadsheet!
Comment 1 Josh Micich 2009-07-06 13:06:27 UTC
I think the mistake is in OOO Calc - line 651 of xetable.cxx:
(http://svn.services.openoffice.org/ooo/trunk/sc/source/filter/excel/xetable.cxx)
This is inconsistent with the documentation.

I would propose this fix:

Index: xetable.cxx
===================================================================
--- xetable.cxx (revision 268869)
+++ xetable.cxx (working copy)
@@ -648,7 +648,7 @@

 void XclExpBooleanCell::WriteContents( XclExpStream& rStrm )
 {
-    rStrm << sal_uInt16( mbValue ? 1 : 0 ) << EXC_BOOLERR_BOOL;
+    rStrm << sal_uInt8( mbValue ? 1 : 0 ) << EXC_BOOLERR_BOOL;
 }

 // ----------------------------------------------------------------------------


I guess Excel is able to read the file because the desired value of 0 (==EXC_BOOLERR_BOOL) still gets written to the second data byte.  


Fixed in svn r791595

I wrote a unit test to reproduce the problem and also modified POI to tolerate the OOO Calc bug.