PartDesign (core): fix inability to deactivate active object
It was impossible to deactivate active object (Part or Body) with: Gui.ActiveDocument.ActiveView.setActiveObject("pdbody",None)
This commit is contained in:
parent
c344e83f05
commit
23d905e869
|
@ -40,19 +40,21 @@ using namespace Gui;
|
||||||
|
|
||||||
void Gui::ActiveObjectList::setObject(App::DocumentObject* obj, const char* name, const Gui::HighlightMode& mode)
|
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 (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);
|
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
|
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)
|
void ActiveObjectList::objectDeleted(const ViewProviderDocumentObject& viewProviderIn)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user