Salome HOME
Support of wide string
[modules/shaper.git] / src / PartSet / PartSet_Validators.cpp
index 979ef341c75b3ee54ea4c9dccf02de5995664d4d..76c8e61566cd287be78bc273012f5560eaae313a 100644 (file)
@@ -75,7 +75,7 @@ int shapesNbPoints(const ModuleBase_ISelection* theSelection)
   return aCount;
 }
 
-typedef std::unordered_map<GeomAbs_CurveType, int> ShapeQuantity;
+typedef std::unordered_map<int, int> ShapeQuantity;
 
 int shapesNbEdges(const ModuleBase_ISelection* theSelection, ShapeQuantity& theEdges)
 {
@@ -90,7 +90,7 @@ int shapesNbEdges(const ModuleBase_ISelection* theSelection, ShapeQuantity& theE
         Standard_Real aStart, aEnd;
         Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aEdge, aStart, aEnd);
         GeomAdaptor_Curve aAdaptor(aCurve);
-        theEdges[aAdaptor.GetType()] += 1;
+        theEdges[(int)aAdaptor.GetType()] += 1;
         aCount++;
       }
     }
@@ -435,8 +435,9 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
             continue;
           if (isObject) {
             if (aRef->object() == anObject) {
-              theError = errorMessage(EqualObjects, anObject.get() ? anObject->data()->name() : "",
-                                      theAttribute->id(), aRef->id());
+              theError = errorMessage(EqualObjects,
+                anObject.get() ? ModelAPI_Tools::toString(anObject->data()->name()) : "",
+                theAttribute->id(), aRef->id());
               return false;
             }
           }
@@ -512,8 +513,9 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
             std::dynamic_pointer_cast<ModelAPI_AttributeReference>(*anAttr);
           // check the object is already presented
           if (aRef->value() == anObject) {
-            theError = errorMessage(EqualObjects, anObject.get() ? anObject->data()->name() : "",
-                                    theAttribute->id(), aRef->id());
+            theError = errorMessage(EqualObjects,
+              anObject.get() ? ModelAPI_Tools::toString(anObject->data()->name()) : "",
+              theAttribute->id(), aRef->id());
             return false;
           }
         }
@@ -608,8 +610,9 @@ bool PartSet_DifferentObjectsValidator::isValid(const AttributePtr& theAttribute
             for (int j = 0; j < aRefSelList->size(); j++) {
               if (aCurSelObject == aRefSelList->object(j)) {
                 theError = errorMessage(EqualObjects,
-                              aCurSelObject.get() ? aCurSelObject->data()->name() : "",
-                              theAttribute->id(), aCurSelList->id());
+                  aCurSelObject.get()?
+                  ModelAPI_Tools::toString(aCurSelObject->data()->name()) : "",
+                  theAttribute->id(), aCurSelList->id());
                 return false;
               }
             }