From aed303f4ffbf548b7bab19dfba8f243bfd4f4ca9 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Tue, 26 May 2015 21:43:58 +0100 Subject: [PATCH] FEM: Add curly brackets to one line for/if or if/if commands Signed-off-by: Przemo Firszt --- src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp | 12 ++++++++---- src/Mod/Fem/Gui/TaskFemConstraintForce.cpp | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp index 503307f82..cd7b2075c 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp @@ -144,13 +144,17 @@ void TaskFemConstraintFixed::onSelectionChanged(const Gui::SelectionChanges& msg // Avoid duplicates std::size_t pos = 0; - for (; pos < Objects.size(); pos++) - if (obj == Objects[pos]) + for (; pos < Objects.size(); pos++) { + if (obj == Objects[pos]) { break; + } + } - if (pos != Objects.size()) - if (subName == SubElements[pos]) + if (pos != Objects.size()) { + if (subName == SubElements[pos]) { return; + } + } // add the new reference Objects.push_back(obj); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index df9035c20..38a98183e 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -184,13 +184,17 @@ void TaskFemConstraintForce::onSelectionChanged(const Gui::SelectionChanges& msg // Avoid duplicates std::size_t pos = 0; - for (; pos < Objects.size(); pos++) - if (obj == Objects[pos]) + for (; pos < Objects.size(); pos++) { + if (obj == Objects[pos]) { break; + } + } - if (pos != Objects.size()) - if (subName == SubElements[pos]) + if (pos != Objects.size()) { + if (subName == SubElements[pos]) { return; + } + } // add the new reference Objects.push_back(obj);