Salome HOME
Merge remote-tracking branch 'remotes/origin/occ/19115' into fixes_for_950
[modules/shaper.git] / src / ModuleBase / ModuleBase_ViewerFilters.cpp
index c28b2eaa9b2ce1713e89c6ece76ac17e0b7773cc..f3d5da98616e593b5b216c6bc4d4b3a5cd78e769 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -80,11 +80,12 @@ Standard_Boolean ModuleBase_ShapeDocumentFilter::IsOk(
       DocumentPtr aDoc = aObj->document();
       SessionPtr aMgr = ModelAPI_Session::get();
 
-      ModuleBase_ModelWidget* aWidget = anOperation->propertyPanel()->activeWidget();
-      if (aWidget && aWidget->canUseExternalParts())
-        aValid = Standard_True;
-      else
-        aValid = (aDoc == aMgr->activeDocument() || aDoc == aMgr->moduleDocument());
+      if (anOperation->propertyPanel()) {
+        ModuleBase_ModelWidget* aWidget = anOperation->propertyPanel()->activeWidget();
+        if (aWidget && aWidget->canUseExternalParts())
+          return Standard_True;
+      }
+      return (aDoc == aMgr->activeDocument() || aDoc == aMgr->moduleDocument());
     }
     else {
       // This object is not controlled by the filter
@@ -157,6 +158,8 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
                 case Prs3d_DP_ZAxis:
                   aDir = anAxis.Direction();
                   break;
+                default: // [to avoid compilation warning]
+                  break;
                 }
                 gp_Lin aLine(aTrihedron->Component()->Location(), aDir);
                 return aPlane.Contains(aLine, Precision::Confusion(), Precision::Angular());