Issue 103365

Summary: value field of BOOLERR record should be just one byte
Product: Calc Reporter: josh_micich <josh.micich>
Component: save-exportAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P5 (lowest) CC: damjan, elish, issues
Version: OOo 3.0.1Keywords: needhelp
Target Milestone: ---   
Hardware: All   
OS: All   
URL: https://issues.apache.org/bugzilla/show_bug.cgi?id=47479
Issue Type: DEFECT Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---

Description josh_micich 2009-07-06 21:44:10 UTC
Currently Cacl writes two bytes for the value field when the record type is EXC_BOOLERR_BOOL.  Correct behaviour occurs when the record type is EXC_BOOLERR_ERROR - the value is written as a single byte (since mnErrCode is sal_uInt8)

Excel seems to handle this OK but POI (until the recent patch) does not.

This should be a one line fix to xetable.cxx:
http://svn.services.openoffice.org/ooo/trunk/sc/source/filter/excel/xetable.cxx

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;
 }

 // ----------------------------------------------------------------------------
Comment 1 damjan 2023-09-29 01:29:50 UTC
This is a real bug, with a test case in the linked Apache POI bug.

Josh: thank you for your bug report. Can we please use your patch under the Apache License V2?