From 600b119e1d94c7a572cbffe0ea843661f8167720 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 18 Aug 2015 16:21:18 +0300 Subject: [PATCH] Fix for the remove of sketch element in delete: on apply it was still in the sketch result. --- src/Model/Model_AttributeRefList.cpp | 3 +++ src/Model/Model_Document.cpp | 7 ++++++- src/Model/Model_ResultCompSolid.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) 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 +} -- 2.39.2