]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Indexes for sequences corrected. BR_hydro_v_0_7
authoradv <adv@opencascade.com>
Mon, 30 Dec 2013 12:35:58 +0000 (12:35 +0000)
committeradv <adv@opencascade.com>
Mon, 30 Dec 2013 12:35:58 +0000 (12:35 +0000)
src/HYDROPy/CAS/NCollection_Sequence.sip
src/HYDROPy/HYDROData_SequenceOfObjects.sip

index 12f906117ee3aeee9dfb9d7136461d6ad960691b..ed07ef948ec72689a9bded9aaced05552d2fdcba 100644 (file)
@@ -40,7 +40,7 @@ template<TYPE>
         return NULL;
 
     // Set the list elements.
-    for (int i = 0; i < sipCpp->Length(); ++i)
+    for (int i = 1; i <= sipCpp->Length(); ++i)
     {
         TYPE *t = new TYPE(sipCpp->Value(i));
         PyObject *tobj;
@@ -53,7 +53,7 @@ template<TYPE>
             return NULL;
         }
 
-        PyList_SET_ITEM(l, i, tobj);
+        PyList_SET_ITEM(l, i - 1, tobj);
     }
 
     return l;
@@ -82,7 +82,7 @@ template<TYPE>
         return 1;
     }
 
-    NCollection_Sequence<TYPE> *ql = new NCollection_Sequence<TYPE>;
+    NCollection_Sequence<TYPE> *aSeq = new NCollection_Sequence<TYPE>;
     len = PySequence_Size(sipPy);
  
     for (SIP_SSIZE_T i = 0; i < len; ++i)
@@ -97,16 +97,16 @@ template<TYPE>
         {
             sipReleaseType(t, sipType_TYPE, state);
 
-            delete ql;
+            delete aSeq;
             return 0;
         }
 
-        ql->Append(*t);
+        aSeq->Append(*t);
 
         sipReleaseType(t, sipType_TYPE, state);
     }
  
-    *sipCppPtr = ql;
+    *sipCppPtr = aSeq;
  
     return sipGetState(sipTransferObj);
 %End
index be9b94cc356d14722af614fc388d238d9952470f..3af3646bd3eb3b265bb0234737ee6ed8f9510389 100644 (file)
@@ -38,7 +38,7 @@
         return NULL;
 
     // Set the list elements.
-    for (int i = 0; i < sipCpp->Length(); ++i)
+    for (int i = 1; i <= sipCpp->Length(); ++i)
     {
        HYDROData_Entity* aPntr = createPointer(sipCpp->Value(i));
      
@@ -54,7 +54,7 @@
             return NULL;
         }
 
-        PyList_SET_ITEM(l, i, tobj);
+        PyList_SET_ITEM(l, i - 1, tobj);
     }
 
     return l;
@@ -83,7 +83,7 @@
         return 1;
     }
 
-    NCollection_Sequence<Handle_HYDROData_Entity> *ql = 
+    NCollection_Sequence<Handle_HYDROData_Entity> *aSeq = 
       new NCollection_Sequence<Handle_HYDROData_Entity>;
     len = PySequence_Size(sipPy);
  
         {
             sipReleaseType(t, sipType_HYDROData_Entity, state);
 
-            delete ql;
+            delete aSeq;
             return 0;
         }
 
         Handle_HYDROData_Entity anEnt( t );
-        ql->Append( anEnt );
+        aSeq->Append( anEnt );
 
         //sipReleaseType(t, sipType_HYDROData_Entity, state);
     }
  
-    *sipCppPtr = ql;
+    *sipCppPtr = aSeq;
  
     return sipGetState(sipTransferObj);
 %End