}
stopActionMode();
- int aMainSect = aSections[0];
- int aMainSectSize = myCurve->getNbPoints(aMainSect);
- for( int i = 1 ; i < aSections.size() ; i++ ){
- int aSectNum = aSections[i] - (i-1);
- myCurve->join( aMainSect, aSectNum );
- mySectionView->sectionsRemoved( aSectNum );
+ std::list<int> aSectionsToJoin;
+ for( int i = 0; i < aSections.size() ; i++ ){
+ aSectionsToJoin.push_back( aSections[i] );
+ }
+
+ if ( myCurve->join( aSectionsToJoin ) )
+ {
+ for( int i = 0, aSectionsSize = aSectionsToJoin.size(); i < aSectionsSize; i++ )
+ mySectionView->sectionsRemoved( i );
}
+
updateUndoRedo();
}
if( !myCurve )
return;
stopActionMode();
- myCurve->join( 0, myCurve->getNbSections()-1 );
+
+ std::list<int> aSectionsToJoin;
+ for( int i = 0, aNb = myCurve->getNbSections(); i < aNb ; i++ ){
+ aSectionsToJoin.push_back( i );
+ }
+ bool aRes = myCurve->join( aSectionsToJoin );
+
mySectionView->reset();
updateActionsStates();
updateUndoRedo();