View Issue Details

IDProjectCategoryView StatusLast Update
0003363Expressions[FreeCAD] Bugpublic2018-03-25 10:16
Reporterulrich1aAssigned Toeivindkvedalen 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version[FreeCAD] 0.17 
Target VersionFixed in Version[FreeCAD] 0.17 
Summary0003363: Nested conditionals statement fails with additional conditional statement in false-branch
DescriptionThe 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 ReproduceAdd 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 InformationThe 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
Tagsexpressions

Activities

Kunda1

2018-03-10 01:42

administrator   ~0011032

@eivindkvedalen care to weigh in on this ticket ?

wmayer

2018-03-25 10:16

administrator   ~0011055

https://github.com/FreeCAD/FreeCAD/commit/0574ac37eda08c35786496091ace4636ce779c58

Issue History

Date Modified Username Field Change
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