From: mpv Date: Thu, 22 Aug 2019 15:33:32 +0000 (+0300) Subject: Fix for the issue #2958: Application errors when Remove part X-Git-Tag: VEDF2019Lot4~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b0f8183413d5b627299814b3d7be08b6895bb5b;p=modules%2Fshaper.git Fix for the issue #2958: Application errors when Remove part --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 082a6c60f..b7a295935 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -892,9 +892,10 @@ void Model_Document::undoInternal(const bool theWithSubs, const bool theSynchron myDoc->Undo(); } + std::set aSubs; if (theWithSubs) { // undo for all subs - const std::set aSubs = subDocuments(); + aSubs = subDocuments(); std::set::iterator aSubIter = aSubs.begin(); for (; aSubIter != aSubs.end(); aSubIter++) { if (!subDoc(*aSubIter)->myObjs) @@ -907,6 +908,19 @@ void Model_Document::undoInternal(const bool theWithSubs, const bool theSynchron myObjs->synchronizeFeatures(aDeltaLabels, true, false, false, isRoot()); // update the current features status setCurrentFeature(currentFeature(false), false); + + if (theWithSubs) { + // undo for all subs + const std::set aNewSubs = subDocuments(); + std::set::iterator aNewSubIter = aNewSubs.begin(); + for (; aNewSubIter != aNewSubs.end(); aNewSubIter++) { + // synchronize only newly appeared documents + if (!subDoc(*aNewSubIter)->myObjs || aSubs.find(*aNewSubIter) != aSubs.end()) + continue; + TDF_LabelList anEmptyDeltas; + subDoc(*aNewSubIter)->myObjs->synchronizeFeatures(anEmptyDeltas, true, false, true, true); + } + } } }