From: nds Date: Wed, 18 Dec 2013 05:03:47 +0000 (+0000) Subject: refs #249 - Undo after Join selected sections operation works not properly X-Git-Tag: BR_hydro_v_0_6~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2d5ca9ab4332bedb9fc8b193c9f0b4f6d3fa8ce7;p=modules%2Fhydro.git refs #249 - Undo after Join selected sections operation works not properly --- diff --git a/src/HYDROCurveCreator/CurveCreator_Curve.cxx b/src/HYDROCurveCreator/CurveCreator_Curve.cxx index a4f9947c..438b4215 100644 --- a/src/HYDROCurveCreator/CurveCreator_Curve.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Curve.cxx @@ -394,7 +394,7 @@ bool CurveCreator_Curve::joinInternal( const int theISectionTo, aSection2->myPoints.begin(), aSection2->myPoints.end()); - res = removeSection(theISectionFrom); + res = removeSectionInternal(theISectionFrom); redisplayCurve(); return res; } diff --git a/src/HYDROCurveCreator/CurveCreator_Diff.cxx b/src/HYDROCurveCreator/CurveCreator_Diff.cxx index b2cecfd8..797cc68b 100644 --- a/src/HYDROCurveCreator/CurveCreator_Diff.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Diff.cxx @@ -190,8 +190,18 @@ bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve, setNbUndos(3); } + // Construct undo for RemovePoints command. + int anISection = theIntParam1; + const int aNbPoints2 = theCurve->getNbPoints(theIntParam2); + CurveCreator_ICurve::SectionToPointList aSectionToPointList; + int aJoinedSize = aNbPoints + aNbPoints2; + for (int anIPoint = aNbPoints; anIPoint < aJoinedSize; anIPoint++) + aSectionToPointList.push_back(std::make_pair( anISection, anIPoint ) ); isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints, - theIntParam1, aNbPoints, -1); + aSectionToPointList); + + //isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints, + // theIntParam1, aNbPoints, -1); if (isOK) { isOK = addSectionToUndo(theCurve, theIntParam2, myPUndo[1]);