Skip to content

Commit

Permalink
VariablesWindow now supports changing the data type of a variable eve…
Browse files Browse the repository at this point in the history
…n when the old and new values compare equal (e.g. 1 to true)
  • Loading branch information
cstawarz committed Sep 8, 2017
1 parent 8a797a9 commit 639fc32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/client/VariablesWindow/MWVariablesWindowController.m
Expand Up @@ -339,7 +339,10 @@ - (void)setValue:(NSString *)value forVariable:(NSString *)name {
} catch (const mw::SimpleException &) {
val.setString(valueUTF8);
}
if ([variables valueForVariable:name] != val) {
mw::Datum oldVal = [variables valueForVariable:name];
if (oldVal != val ||
oldVal.getDataType() != val.getDataType() /* Support data type change, e.g. int->bool */)
{
[variables setValue:val forVariable:name];
}
}
Expand Down

0 comments on commit 639fc32

Please sign in to comment.