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();
}