Salome HOME
Add tests to improve coverage of Filters plugin.
[modules/shaper.git] / src / FiltersAPI / FiltersAPI_Filter.cpp
index c39d0c7caca0577a938cd4ae065b3df47621ae98..577e428bc81bca3d78f1d29a5be06396bcdb75be 100644 (file)
@@ -38,15 +38,16 @@ FiltersAPI_Filter::FiltersAPI_Filter(const std::string& theName,
                                      const std::list<AttributePtr>& theArguments)
   : myName(theName)
 {
-  for (std::list<AttributePtr>::const_iterator anArgIt = theArguments.begin();
-       anArgIt != theArguments.end(); ++anArgIt) {
-    AttributeBooleanPtr aBoolAttr =
+  std::list<AttributePtr>::const_iterator anArgIt = theArguments.begin();
+  // first attribute is usually for reversing the filter
+  AttributeBooleanPtr aBoolAttr =
       std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(*anArgIt);
-    if (aBoolAttr) {
-      myReversed = aBoolAttr->value();
-      continue;
-    }
+  if (aBoolAttr) {
+    myReversed = aBoolAttr->value();
+    ++anArgIt;
+  }
 
+  for (; anArgIt != theArguments.end(); ++anArgIt) {
     AttributeSelectionListPtr aSelList =
         std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*anArgIt);
     if (aSelList) {