View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003363||Expressions||[FreeCAD] Bug||public||2018-03-03 22:28||2018-03-25 10:16|
|Product Version||[FreeCAD] 0.17|
|Target Version||Fixed in Version||[FreeCAD] 0.17|
|Summary||0003363: Nested conditionals statement fails with additional conditional statement in false-branch|
|Description||The conditional statement in the spreadsheet and in expressions does not handle nested statements correct, if an additional conditional statement is added to the false-branch.|
It is possible to add an conditional statement to the false-branch in the spreadsheet, when it is enclosed in parentheses. These parentheses are removed during input. After an save and reload of the document new parentheses are added at wrong positions and the expression fails to give the intended result.
A nested conditional statement in the true-branch does work also after a save and reload of the document.
|Steps To Reproduce||Add a spreadsheet to a document.|
Put in 1 in Cell A1
Put the following expression in cell B1: =A1==1?11:(A1==2?12:13)
This expression works and gives 11, 12, 13 for values of 1, 2, 3 in cell A1.
Although the expression has changed to: =A1 == 1 ? 11 : A1 == 2 ? 12 : 13
Save and reopen the document.
Now the expression looks: =(A1 == 1 ? 11 : A1) == 2 ? 12 : 13
It gives now the following results 13, 12, 13 for the inputs 1, 2, 3 in cell A1
|Additional Information||The bug was reported in the German forum from user heilo: https://forum.freecadweb.org/viewtopic.php?f=13&t=27186|
There is an additional report: https://forum.freecadweb.org/viewtopic.php?f=3&t=27226
|2018-03-03 22:28||ulrich1a||New Issue|
|2018-03-03 22:28||ulrich1a||Tag Attached: expressions|
|2018-03-10 01:42||Kunda1||Note Added: 0011032|
|2018-03-10 21:07||eivindkvedalen||Assigned To||=> eivindkvedalen|
|2018-03-10 21:07||eivindkvedalen||Status||new => assigned|
|2018-03-25 10:16||wmayer||Status||assigned => closed|
|2018-03-25 10:16||wmayer||Resolution||open => fixed|
|2018-03-25 10:16||wmayer||Fixed in Version||=> 0.17|
|2018-03-25 10:16||wmayer||Note Added: 0011055|