Apache OpenOffice (AOO) Bugzilla – Issue 6282
BASIC function returns wrong result
Last modified: 2013-02-24 21:00:54 UTC
I think this is a severe defect: The spreadsheet looks right, but some values are wrong. We have been using our own tax calculation functions in StarOffice 4.0 and 5.2, but they do not run reliably in OOO 1.0.0 (all German). On every PC, we store the functions in C:\Programme\OpenOffice.org1.0\user\basic\Standard\Module1.xba. We call them directly from a cell of a spreadsheet. Sometimes they run properly. But sometimes they return a WRONG result, that obviously is derived from an older value of another cell. Somehow, the spreadsheet application doesn't notice that a value of the other cell has changed and supplies the tax function with an outdated parameter. This problem does not arise when the function is stored in the spreadsheet itself rather than centrally. Apart from that, I am deeply impressed with what level of stability OpenOffice has achieved so far. Dr. Klaus Foerst, tax consultant, Flensburg, Germany
set the flags for scripting. Frank
Andreas, please have a look at this...
I could reproduce the problem but the Basic always returns the correct result (cheched by adding some print commands in Basic). The problem seems to be that the spreadsheet document doesn't always adopt the result. Niklas should check this.
No, the line "SPLITTINGTARIF2001 = ZwiWert" doesn't work after the second call. The function SPLITTINGTARIF2001 is of type Long, the variable ZwiWert of type Single. Apparently, the SbMethod's SBX_FIXED flag is reset from SbxVariable::Broadcast, so its type is changed and on subsequent calls the function can't be assigned the result.
I can reproduce the behaviour
Fixed in sbxmod.cxx 1.11
Closed
.