diff --git a/src/Gui/ActiveObjectList.cpp b/src/Gui/ActiveObjectList.cpp index 227ba4ce5c..e4ed5b4c2b 100644 --- a/src/Gui/ActiveObjectList.cpp +++ b/src/Gui/ActiveObjectList.cpp @@ -80,7 +80,7 @@ Gui::ActiveObjectList::ObjectInfo Gui::ActiveObjectList::getObjectInfo(App::Docu return info; if(subname) { info.obj = obj; - if(subname) info.subname = subname; + info.subname = subname; }else{ // If the input object is not from this document, it must be brought in // by some link type object of this document. We only accept the object diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 50f74acd8d..515a3c6328 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1511,44 +1511,42 @@ void SelectionSingleton::clearSelection(const char* pDocName, bool clearPreSelec // Because the introduction of external editing, it is best to make // clearSelection(0) behave as clearCompleteSelection(), which is the same // behavior of python Selection.clearSelection(None) - if(!pDocName || !pDocName[0] || strcmp(pDocName,"*")==0) { + if (!pDocName || !pDocName[0] || strcmp(pDocName,"*")==0) { clearCompleteSelection(clearPreSelect); return; } - if(_PickedList.size()) { + if (_PickedList.size()) { _PickedList.clear(); notify(SelectionChanges(SelectionChanges::PickedListChanged)); } App::Document* pDoc; pDoc = getDocument(pDocName); - if(pDoc) { - std::string docName; - if (pDocName) - docName = pDocName; - else - docName = pDoc->getName(); // active document - - if(clearPreSelect && DocName == docName) + if (pDoc) { + std::string docName = pDocName; + if (clearPreSelect && DocName == docName) rmvPreselect(); bool touched = false; - for(auto it=_SelList.begin();it!=_SelList.end();) { - if(it->DocName == docName) { + for (auto it=_SelList.begin();it!=_SelList.end();) { + if (it->DocName == docName) { touched = true; it = _SelList.erase(it); - }else + } + else { ++it; + } } - if(!touched) + + if (!touched) return; - if(!logDisabled) { + if (!logDisabled) { std::ostringstream ss; ss << "Gui.Selection.clearSelection('" << docName << "'"; - if(!clearPreSelect) - ss << ",False"; + if (!clearPreSelect) + ss << ", False"; ss << ')'; Application::Instance->macroManager()->addLine(MacroManager::Cmt,ss.str().c_str()); } diff --git a/src/Gui/TaskView/TaskDialogPython.cpp b/src/Gui/TaskView/TaskDialogPython.cpp index 9ff860cf84..d5cc3e8c3f 100644 --- a/src/Gui/TaskView/TaskDialogPython.cpp +++ b/src/Gui/TaskView/TaskDialogPython.cpp @@ -178,7 +178,7 @@ TaskWatcherPython::TaskWatcherPython(const Py::Object& o) Gui::TaskView::TaskBox *tb = 0; if (watcher.hasAttr(std::string("commands"))) { - if (!tb) tb = new Gui::TaskView::TaskBox(icon, title, true, 0); + tb = new Gui::TaskView::TaskBox(icon, title, true, 0); Py::Sequence cmds(watcher.getAttr(std::string("commands"))); CommandManager &mgr = Gui::Application::Instance->commandManager(); for (Py::Sequence::iterator it = cmds.begin(); it != cmds.end(); ++it) {