Skip to content

Commit

Permalink
PartDesign (core): fix inability to deactivate active object
Browse files Browse the repository at this point in the history
It was impossible to deactivate active object (Part or Body) with:
Gui.ActiveDocument.ActiveView.setActiveObject("pdbody",None)
  • Loading branch information
DeepSOIC committed May 20, 2016
1 parent c344e83 commit 23d905e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Gui/ActiveObjectList.cpp
Expand Up @@ -40,19 +40,21 @@ using namespace Gui;

void Gui::ActiveObjectList::setObject(App::DocumentObject* obj, const char* name, const Gui::HighlightMode& mode)
{
if (hasObject(name)){
Gui::Application::Instance->activeDocument()->signalHighlightObject(*dynamic_cast<Gui::ViewProviderDocumentObject*>(Gui::Application::Instance->activeDocument()->getViewProvider(getObject<App::DocumentObject*>(name))), mode, false);
}
if (obj){
if (hasObject(name)){
Gui::Application::Instance->activeDocument()->signalHighlightObject(*dynamic_cast<Gui::ViewProviderDocumentObject*>(Gui::Application::Instance->activeDocument()->getViewProvider(getObject<App::DocumentObject*>(name))), mode, false);
}
_ObjectMap[name] = obj;

Gui::Application::Instance->activeDocument()->signalHighlightObject(*dynamic_cast<Gui::ViewProviderDocumentObject*>(Gui::Application::Instance->activeDocument()->getViewProvider(obj)), mode, true);
_ObjectMap[name] = obj;
} else {
if (hasObject(name))
_ObjectMap.erase(name);
}
}

bool Gui::ActiveObjectList::hasObject(const char*name)const
{
return _ObjectMap.find(name) != _ObjectMap.end();
return _ObjectMap.find(name) != _ObjectMap.end();
}

void ActiveObjectList::objectDeleted(const ViewProviderDocumentObject& viewProviderIn)
Expand Down

0 comments on commit 23d905e

Please sign in to comment.