]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the remove of sketch element in delete: on apply it was still in the sketch...
authormpv <mpv@opencascade.com>
Tue, 18 Aug 2015 13:21:18 +0000 (16:21 +0300)
committermpv <mpv@opencascade.com>
Tue, 18 Aug 2015 13:21:18 +0000 (16:21 +0300)
src/Model/Model_AttributeRefList.cpp
src/Model/Model_Document.cpp
src/Model/Model_ResultCompSolid.cpp

index 9b8db073d1b7941f505ff690198b765f82ee5f82..443d089bbad60593fe789e789519613a1adb44cd 100644 (file)
@@ -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);
     }
   }
 }
index d91389b3ed623237139ce6b4dd9d66c416143502..5d33e78ba6ae330eb1344b3dbb757bb9c48f6e29 100644 (file)
@@ -34,6 +34,7 @@
 #include <TDF_AttributeDelta.hxx>
 #include <TDF_AttributeDeltaList.hxx>
 #include <TDF_ListIteratorOfAttributeDeltaList.hxx>
+#include <TDF_ListIteratorOfLabelList.hxx>
 
 #include <climits>
 #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()) {
index b8b788e22dfab486a14036583a52fe795609704d..263c7c33bc8121d6bc4c8d0850fa4e741db3b49f 100755 (executable)
@@ -139,4 +139,4 @@ void Model_ResultCompSolid::updateSubs(const std::shared_ptr<GeomAPI_Shape>& the
       mySubs.pop_back();
     }
   }
-}
\ No newline at end of file
+}