Salome HOME
Merge remote-tracking branch 'remotes/origin/EDF_2020_Lot2'
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetMultiSelector.cpp
index a6acbc519b1ac581030d6d86aed1f3d39a49630d..21df54023958ca84d37343e5786b1b51688c5c2e 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
@@ -765,8 +765,6 @@ QIntList ModuleBase_WidgetMultiSelector::shapeTypes() const
 //********************************************************************
 void ModuleBase_WidgetMultiSelector::setCurrentShapeType(const int theShapeType)
 {
-  QString aShapeTypeName;
-
   int idx = 0;
   foreach (QString aShapeTypeName, myShapeTypes) {
     int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName);
@@ -816,10 +814,10 @@ void ModuleBase_WidgetMultiSelector::updateSelectionList()
   else if (aType == ModelAPI_AttributeRefAttrList::typeId()) {
     AttributeRefAttrListPtr aRefAttrListAttr = aData->refattrlist(attributeID());
     for (int i = 0; i < aRefAttrListAttr->size(); i++) {
-      AttributePtr anAttribute = aRefAttrListAttr->attribute(i);
+      AttributePtr anAttr = aRefAttrListAttr->attribute(i);
       QString aName;
-      if (anAttribute.get()) {
-        std::wstring anAttrName = ModuleBase_Tools::generateName(anAttribute, myWorkshop);
+      if (anAttr.get()) {
+        std::wstring anAttrName = ModuleBase_Tools::generateName(anAttr, myWorkshop);
         aName = QString::fromStdWString(anAttrName);
       }
       else {
@@ -932,9 +930,9 @@ void ModuleBase_WidgetMultiSelector::convertIndicesToViewerSelection(std::set<in
       if (!anObject.get())
         continue;
       TopoDS_Shape aShape;
-      AttributePtr anAttribute = aRefAttrListAttr->attribute(i);
-      if (anAttribute.get()) {
-        GeomShapePtr aGeomShape = ModuleBase_Tools::getShape(anAttribute, myWorkshop);
+      AttributePtr anAttr = aRefAttrListAttr->attribute(i);
+      if (anAttr.get()) {
+        GeomShapePtr aGeomShape = ModuleBase_Tools::getShape(anAttr, myWorkshop);
         theValues.append(std::shared_ptr<ModuleBase_ViewerPrs>(
                new ModuleBase_ViewerPrs(anObject, aGeomShape, NULL)));
       }
@@ -1005,8 +1003,8 @@ bool ModuleBase_WidgetMultiSelector::removeUnusedAttributeObjects
     for (int i = 0; i < aRefAttrListAttr->size(); i++) {
       bool aFound = false;
       if (aRefAttrListAttr->isAttribute(i)) {
-        AttributePtr anAttribute = aRefAttrListAttr->attribute(i);
-        aFound = anAttributes.find(anAttribute) != anAttributes.end();
+        AttributePtr anAttr = aRefAttrListAttr->attribute(i);
+        aFound = anAttributes.find(anAttr) != anAttributes.end();
       }
       else {
         aFound = findInSelection(aRefAttrListAttr->object(i), GeomShapePtr(), aGeomSelection,
@@ -1141,6 +1139,8 @@ QList<ActionInfo>
         i--;
       }
       break;
+    default: // [to avoid compilation warning]
+      break;
     }
   }
   return aList;