diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index 99fcdc47e0..2f81c4021e 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -426,7 +426,7 @@ void SoFCUnifiedSelection::doAction(SoAction *action) this->colorHighlight = colaction->highlightColor; } - if (highlightMode.getValue() != OFF && action->getTypeId() == SoFCHighlightAction::getClassTypeId()) { + if (action->getTypeId() == SoFCHighlightAction::getClassTypeId()) { SoFCHighlightAction *hilaction = static_cast(action); // Do not clear currently highlighted object when setting new pre-selection if (!setPreSelection && hilaction->SelChange.Type == SelectionChanges::RmvPreselect) { @@ -436,7 +436,8 @@ void SoFCUnifiedSelection::doAction(SoAction *action) currenthighlight->unref(); currenthighlight = 0; } - } else if (hilaction->SelChange.Type == SelectionChanges::SetPreselect) { + } else if (highlightMode.getValue() != OFF + && hilaction->SelChange.Type == SelectionChanges::SetPreselect) { if (currenthighlight) { SoHighlightElementAction action; action.apply(currenthighlight); @@ -463,10 +464,12 @@ void SoFCUnifiedSelection::doAction(SoAction *action) return; } - if (selectionMode.getValue() == ON && action->getTypeId() == SoFCSelectionAction::getClassTypeId()) { + if (action->getTypeId() == SoFCSelectionAction::getClassTypeId()) { SoFCSelectionAction *selaction = static_cast(action); - if (selaction->SelChange.Type == SelectionChanges::AddSelection || - selaction->SelChange.Type == SelectionChanges::RmvSelection) { + if(selectionMode.getValue() == ON + && (selaction->SelChange.Type == SelectionChanges::AddSelection + || selaction->SelChange.Type == SelectionChanges::RmvSelection)) + { // selection changes inside the 3d view are handled in handleEvent() App::Document* doc = App::GetApplication().getDocument(selaction->SelChange.pDocName); App::DocumentObject* obj = doc->getObject(selaction->SelChange.pObjectName); @@ -508,7 +511,8 @@ void SoFCUnifiedSelection::doAction(SoAction *action) SoSelectionElementAction action(SoSelectionElementAction::None); for(int i=0;igetNumChildren();++i) action.apply(this->getChild(i)); - }else if(selaction->SelChange.Type == SelectionChanges::SetSelection) { + }else if(selectionMode.getValue() == ON + && selaction->SelChange.Type == SelectionChanges::SetSelection) { std::vector vps; if (this->pcDocument) vps = this->pcDocument->getViewProvidersOfType(ViewProviderDocumentObject::getClassTypeId());