summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid E. Narváez <[email protected]>2017-10-09 06:35:56 -0400
committerDavid E. Narváez <[email protected]>2017-10-09 06:35:56 -0400
commit22a22a20c7a8a4c772b65f6ac62c650acccc5555 (patch)
treefd291d9c5e22c7512d453c4540362d771a92bb09
parent27ac86d299d73dd1ae92d6b9f7c819515d6d6082 (diff)
Do Not Clear Selection if Args are Invalid
If things are invalid, you want the selection of the final objects to stay, otherwise it will still be invalid but the user wont' know.
-rw-r--r--modes/macro.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/modes/macro.cc b/modes/macro.cc
index a09d5eb..341736d 100644
--- a/modes/macro.cc
+++ b/modes/macro.cc
@@ -74,7 +74,6 @@ void DefineMacroMode::finalPageEntered()
bool DefineMacroMode::validateObjects()
{
- bool res = true;
ObjectCalcer* (ObjectHolder::*memfun)() = &ObjectHolder::calcer;
std::vector<ObjectCalcer*> given;
std::transform( mgiven.begin(), mgiven.end(),
@@ -93,7 +92,7 @@ bool DefineMacroMode::validateObjects()
"Kig cannot calculate this macro because of this. "
"Please press Back, and construct the objects "
"in the correct order..." ) );
- res = false;
+ return false;
}
else if( !hier.allGivenObjectsUsed() )
{
@@ -103,12 +102,12 @@ bool DefineMacroMode::validateObjects()
"probably means you are expecting Kig to do "
"something impossible. Please check the "
"macro and try again." ) );
- res = false;
+ return false;
}
static_cast<KigView*>( mdoc.widget() )->realWidget()->redrawScreen( std::vector<ObjectHolder*>() );
- return res;
+ return true;
}
void DefineMacroMode::finishPressed()