Issue 58749 - com.sun.star.sheet.FormulaResult.ERROR does not match
Summary: com.sun.star.sheet.FormulaResult.ERROR does not match
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Unix, all
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 18:22 UTC by villeroy
Modified: 2017-05-20 11:27 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description villeroy 2005-12-01 18:22:12 UTC
Please run following basic code:
REM  *****  BASIC  *****
sub test_FormulaResult_ERROR
oDoc = StarDesktop.loadComponentFromURL( "private:factory/scalc", "_blank", 0,
Array() )
oCell = oDoc.getSheets.getByIndex(0).getCellByPosition(0,0)
oCell.setFormula("=1/0")
printResult oCell
end sub
sub printResult(oCell)
lContentType = oCell.getType
lResultType = oCell.FormulaResultType
sFml = oCell.FormulaLocal
if lContentType = com.sun.star.table.CellContentType.FORMULA then
	sResult = sFml &" returning "
	if lResultType = com.sun.star.sheet.FormulaResult.ERROR then
		sResult = sResult & "an error"
	else
		sResult = sResult & "NO error"
	endif
elseif lContentType = com.sun.star.table.CellContentType.TEXT then
	sResult = "Text: "& oCell.getString
elseif lContentType = com.sun.star.table.CellContentType.VALUE then
	sResult = "Number: "& oCell.getValue
endif
msgbox sResult
end sub
Comment 1 villeroy 2005-12-01 19:04:45 UTC
Iforgot to mention:
A constant error-value (generated with paste special) pretends to be a
string-formula
Comment 2 jsc 2005-12-02 08:05:44 UTC
jsc -> nn: it's one for you
Comment 3 niklas.nebel 2006-11-03 11:03:52 UTC
You can query for errors using getError (from XCell).
But FormulaResult contains the ERROR value, so FormulaResultType should be
changed to return it for errors.
Comment 4 niklas.nebel 2006-11-10 14:36:17 UTC
The documentation is wrong, FormulaResultType is of type CellContentType, an
enum that doesn't contain an ERROR value. Changing this might break existing
code. Since a workaround exists (getError), I'm changing this to LATER.
Comment 5 Marcus 2017-05-20 11:27:49 UTC
Reset assigne to the default "issues@openoffice.apache.org".