Issue 103365 - value field of BOOLERR record should be just one byte
Summary: value field of BOOLERR record should be just one byte
Status: CONFIRMED
Alias: None
Product: Calc
Classification: Application
Component: save-export (show other issues)
Version: OOo 3.0.1
Hardware: All All
: P5 (lowest) Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL: https://issues.apache.org/bugzilla/sh...
Keywords: needhelp
Depends on:
Blocks:
 
Reported: 2009-07-06 21:44 UTC by josh_micich
Modified: 2023-09-29 01:29 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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?