Salome HOME
Fix JoinAll operation
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Curve.cxx
index 7732314881c16fce744807370401d6da9500067b..824338b29055919aa2f048b9efc3a97e2ef0724e 100644 (file)
@@ -525,12 +525,15 @@ bool CurveCreator_Curve::join( const int theISectionTo,
                                const int theISectionFrom )
 {
   bool res = false;
-  if (theISectionTo != theISectionFrom) {
+  if (mySections.size() >= 2 && 
+    ( theISectionTo != theISectionFrom || (theISectionTo == -1 && theISectionFrom == -1) )) {
     startOperation();
+    int aISectionTo = getNbSections()-1;
+    int aISectionFrom = 0;
     if (addEmptyDiff())
-      myListDiffs.back().init(this, CurveCreator_Operation::Join, theISectionTo, theISectionFrom);
+      myListDiffs.back().init(this, CurveCreator_Operation::Join, aISectionTo, aISectionFrom);
 
-    res = joinInternal( theISectionTo, theISectionFrom );
+    res = joinInternal( aISectionTo, aISectionFrom );
 
     finishOperation();
   }