Issue 107151 - formula - if() construct not parsed correctly
Summary: formula - if() construct not parsed correctly
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOO310m9
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: kla
QA Contact: issues@sc
URL:
Keywords: oooqa, regression
Depends on:
Blocks: 99999
  Show dependency tree
 
Reported: 2009-11-23 18:12 UTC by vladimir_p
Modified: 2013-08-07 15:14 UTC (History)
3 users (show)

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


Attachments
TESTCASE (8.30 KB, application/vnd.oasis.opendocument.spreadsheet)
2009-11-23 18:12 UTC, vladimir_p
no flags Details
testcase with fewer terms (11.26 KB, application/vnd.oasis.opendocument.spreadsheet)
2009-11-23 19:48 UTC, Regina Henschel
no flags Details
pop used ScEmptyCellToken in Compare() (414 bytes, patch)
2009-11-24 13:56 UTC, dtardon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description vladimir_p 2009-11-23 18:12:07 UTC
Hello

In attached testcase document three varieties of a formula are presented
employing the following schema:

={:numeric_value_a:} - IF({:test:};{:then numeric_value_b:};{:else numeric_value_c})

namely

={:value_a:}-IF(HLOOKUP($cell;$range;$position;$sorted)="";{:then
numeric_value_b:};{:else numeric_value_c})

and

={:value_a:}-IF(ISBLANK(HLOOKUP($cell;$range;$position;$sorted));{:then
numeric_value_b:};{:else numeric_value_c})


The former wording is not giving correct results under OOO310m9 (verified with
HLOOKUP & VLOOKUP cases) although it was used in OOo 2.x without problems.

Please  see the highlighted cells in the attached testcase for further explanation.

Regards
Vladimir
Comment 1 vladimir_p 2009-11-23 18:12:56 UTC
Created attachment 66299 [details]
TESTCASE
Comment 2 Regina Henschel 2009-11-23 19:47:03 UTC
I can confirm it for OOo3.2 m5 on WinXP.

I have reduced the problem in the attached file.

There in cell C14 the term
HLOOKUP(C6;B1:C4;4;1)=""
evaluates to TRUE

and therefore in cell C15 the term
=IF(HLOOKUP(C6;B1:C4;4;1)="";999;555)
evaluates to 999

But in cell c16 the term
=10-IF(HLOOKUP(C6;B1:C4;4;1)="";999;555)
does not evaluate to -989.

You get the same error for all operators + - * / ^
In all cases the number 10 is treated as zero.

The error occurs only in the structure "number - IF" but not in "IF - number".
Comment 3 Regina Henschel 2009-11-23 19:48:29 UTC
Created attachment 66300 [details]
testcase with fewer terms
Comment 4 niklas.nebel 2009-11-24 12:50:54 UTC
taking over
Comment 5 dtardon 2009-11-24 13:56:45 UTC
Created attachment 66317 [details]
pop used ScEmptyCellToken in Compare()
Comment 6 niklas.nebel 2009-11-24 14:10:22 UTC
dtardon, CompareMat needs the same. Otherwise, yes, that was the problem.

It's fixed in CWS "calc32stopper6", svn rev. 277610.
Comment 7 niklas.nebel 2009-11-26 12:50:04 UTC
reassigning to QA for verification
Comment 8 kla 2009-12-04 13:48:06 UTC
I take it for verification.
Comment 9 kla 2009-12-07 16:17:22 UTC
Verified by using reginas sample. Thx for it.
Comment 10 dtardon 2010-04-22 13:00:38 UTC
integrated in OOO320_m8/DEV300_m68