Apache OpenOffice (AOO) Bugzilla – Issue 58572
No native support for TRUE/FALSE primitives in calc.
Last modified: 2017-05-20 10:44:56 UTC
It would be most useful to be able to have the ability to distinguish between a number and a boolean for a cell values in calc. Currently the only boolean support is in the form of the TRUE() & FALSE() functions. This presents a number of limitations * When these functions are evaluated from the api there doesn't seem to be a way to distinguish between 0/1 and true/false as only a number can be retrieved ( table::CellContentType only distinguishes between number, string & function :-( ). * Granted in the code it is possible to distinguish between a number and a boolean via the cell format attributes. This really isn't strong enough... for example if you paste-special ( values only, a common operation ) a cell with a boolean value the formating is lost. * Interfacing with oobasic ( user defined functions ) is also a pain as calc boolean and basic's built-in boolean type evaluate differently ( oobasic true/false value is determined by an expression that evaluates -1, 0 respectively, calc uses 0/1 symantics ) and you can't for example test the boolean value of a cell directly. When you consider that its possible to link form controls ( e.g. checkboxes, optionbuttons )to cells which modify those cells values as a boolean and then want to drive code using those controls its obvious that the situation is far from ideal. * From an interoperability point of view this also presents difficulties as Excel has a built in boolean primitve which acts the same as oobasics boolean primitive. Thoughts?
Hi Niklas, please comment on this one and proceed as needed. Frank
*** Issue 84266 has been marked as a duplicate of this issue. ***
*** Issue 119698 has been marked as a duplicate of this issue. ***
I am using OO 3.3 (Linux rpm version). I was unaware of this defect. I just experimented copying and paste special of a formula which returns 'false'. If I paste all except formulas, 'FALSE' becomes 0. If I omit formats, I also get zero. If I omit numbers, I am left with an empty cell. If I use the Basic code "oSelect.setDataArray( oSelect.getDataArray)," I get a zero. If I use the dispatcher (in code) to paste all except formulas I also get a zero.
Reset the assignee to the default "issues@openoffice.apache.org".