From: mpv Date: Tue, 18 Aug 2015 13:21:18 +0000 (+0300) Subject: Fix for the remove of sketch element in delete: on apply it was still in the sketch... X-Git-Tag: V_1.4.0_beta4~358 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=600b119e1d94c7a572cbffe0ea843661f8167720;p=modules%2Fshaper.git Fix for the remove of sketch element in delete: on apply it was still in the sketch result. --- diff --git a/src/Model/Model_AttributeRefList.cpp b/src/Model/Model_AttributeRefList.cpp index 9b8db073d..443d089bb 100644 --- a/src/Model/Model_AttributeRefList.cpp +++ b/src/Model/Model_AttributeRefList.cpp @@ -149,9 +149,12 @@ void Model_AttributeRefList::substitute(const ObjectPtr& theCurrent, const Objec aNewLab = aNewData->label().Father(); } // do the substitution + ADD_BACK_REF(theNew); if (myRef->InsertAfter(aNewLab, aCurrentLab)) { myRef->Remove(aCurrentLab); + REMOVE_BACK_REF(theCurrent); } + owner()->data()->sendAttributeUpdated(this); } } } diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index d91389b3e..5d33e78ba 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #ifndef WIN32 @@ -395,7 +396,11 @@ static void modifiedLabels(const Handle(TDocStd_Document)& theDoc, TDF_LabelList aDelta = theDoc->GetRedos().First(); else aDelta = theDoc->GetUndos().Last(); - aDelta->Labels(theDelta); + TDF_LabelList aDeltaList; + aDelta->Labels(aDeltaList); // it clears list, so, use new one and then append to the result + for(TDF_ListIteratorOfLabelList aListIter(aDeltaList); aListIter.More(); aListIter.Next()) { + theDelta.Append(aListIter.Value()); + } // add also label of the modified attributes const TDF_AttributeDeltaList& anAttrs = aDelta->AttributeDeltas(); for (TDF_ListIteratorOfAttributeDeltaList anAttr(anAttrs); anAttr.More(); anAttr.Next()) { diff --git a/src/Model/Model_ResultCompSolid.cpp b/src/Model/Model_ResultCompSolid.cpp index b8b788e22..263c7c33b 100755 --- a/src/Model/Model_ResultCompSolid.cpp +++ b/src/Model/Model_ResultCompSolid.cpp @@ -139,4 +139,4 @@ void Model_ResultCompSolid::updateSubs(const std::shared_ptr& the mySubs.pop_back(); } } -} \ No newline at end of file +}