From d9c23ebd5ca6eb6790c8351104f712e6646cfec7 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 17 Dec 2015 17:47:42 +0300 Subject: [PATCH] Correction for: 1. crash by popup menu call on origin, 2. reentered presentation(point) is visualized. --- src/PartSet/PartSet_SketcherReetntrantMgr.cpp | 5 ++++- src/PartSet/PartSet_Tools.cpp | 2 ++ src/XGUI/XGUI_ContextMenuMgr.cpp | 8 +++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index c749c930d..e2e5442d9 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -392,7 +392,10 @@ void PartSet_SketcherReetntrantMgr::createInternalFeature() QList aWidgets = aFactory.getModelWidgets(); foreach (ModuleBase_ModelWidget* aWidget, aWidgets) { - aWidget->setFeature(myInternalFeature, true); + bool isStoreValue = !aFOperation->isEditOperation() && + !aWidget->getDefaultValue().empty() && + !aWidget->isComputedDefault(); + aWidget->setFeature(myInternalFeature, isStoreValue); } ModuleBase_ModelWidget* aFirstWidget = ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget (aWidgets); diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index f9dfb6c0b..893e692c7 100755 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -732,6 +732,8 @@ FeaturePtr PartSet_Tools::findFirstCoincidence(const FeaturePtr& theFeature, std::shared_ptr thePoint) { FeaturePtr aCoincident; + if (theFeature.get() == NULL) + return aCoincident; const std::set& aRefsList = theFeature->data()->refsToMe(); std::set::const_iterator aIt; diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 57c622ac3..940901ce4 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -456,9 +456,11 @@ void XGUI_ContextMenuMgr::addViewerMenu(QMenu* theMenu) const QActionsList aActions; if (aSelected == 1) { ObjectPtr aObject = aPrsList.first().object(); - std::string aName = aObject->groupName(); - if (myViewerMenu.contains(aName)) - aActions = myViewerMenu[aName]; + if (aObject.get() != NULL) { + std::string aName = aObject->groupName(); + if (myViewerMenu.contains(aName)) + aActions = myViewerMenu[aName]; + } aActions.append(action("COLOR_CMD")); } else if (aSelected > 1) { aActions.append(action("HIDE_CMD")); -- 2.39.2