From: mpv Date: Wed, 18 Nov 2015 07:11:49 +0000 (+0300) Subject: Fix for the issue #1050 X-Git-Tag: V_2.0.0~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd1124df80f54493d627266c8de6b362121991c5;p=modules%2Fshaper.git Fix for the issue #1050 --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index a5598b6a5..d96069a65 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -577,9 +577,9 @@ void Model_Document::abortOperation() if (!myNestedNum.empty()) (*myNestedNum.rbegin())--; // roll back the needed number of transactions - // make commit/undo to get the modification delta //myDoc->AbortCommand(); - if (myDoc->CommitCommand()) { + // instead of abort, do commit and undo: to get the delta of modifications + if (myDoc->CommitCommand()) { modifiedLabels(myDoc, aDeltaLabels); myDoc->Undo(); } diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 045dfe44e..03e3db3df 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -340,8 +340,7 @@ void Model_Objects::createHistory(const std::string& theGroupID) { std::map >::iterator aHIter = myHistory.find(theGroupID); if (aHIter == myHistory.end()) { - myHistory[theGroupID] = std::vector(); - std::vector& aResult = myHistory[theGroupID]; + std::vector& aResult = std::vector(); // iterate the array of references and get feature by feature from the array bool isFeature = theGroupID == ModelAPI_Feature::group(); Handle(TDataStd_ReferenceArray) aRefs; @@ -356,7 +355,8 @@ void Model_Objects::createHistory(const std::string& theGroupID) aResult.push_back(aFeature); } } else if (!aFeature->isDisabled()) { // iterate all results of not-disabled feature - const std::list >& aResults = aFeature->results(); + // do not use reference to the list here since results can be changed by "isConcealed" + const std::list > aResults = aFeature->results(); std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { ResultPtr aRes = *aRIter; @@ -370,6 +370,9 @@ void Model_Objects::createHistory(const std::string& theGroupID) } } } + // to be sure that isConcealed did not update the history (issue 1089) during the iteration + if (myHistory.find(theGroupID) == myHistory.end()) + myHistory[theGroupID] = aResult; } }