X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Events.cpp;h=e113d3ae7f73b1cbcd66bce97a8dc37b41ff8172;hb=7cf6494a70682c435e4ac288f2625083f0d52321;hp=30d6e70a4321301f96d804b55120fcf018f7909d;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/Model/Model_Events.cpp b/src/Model/Model_Events.cpp index 30d6e70a4..e113d3ae7 100644 --- a/src/Model/Model_Events.cpp +++ b/src/Model/Model_Events.cpp @@ -88,16 +88,18 @@ void Model_ObjectUpdatedMessage::Join(const std::shared_ptr /////////////////////// DELETED MESSAGE ///////////////////////////// Model_ObjectDeletedMessage::Model_ObjectDeletedMessage( const std::shared_ptr& theDoc, const std::string& theGroup) - : ModelAPI_ObjectDeletedMessage(messageId(), 0), - myDoc(theDoc) + : ModelAPI_ObjectDeletedMessage(messageId(), 0) { - if (!theGroup.empty()) - myGroups.insert(theGroup); + if (!theGroup.empty()) { + myGroups.push_back( + std::pair, std::string>(theDoc, theGroup)); + } } std::shared_ptr Model_ObjectDeletedMessage::newEmpty() { - return std::shared_ptr(new Model_ObjectDeletedMessage(myDoc, "")); + static const std::shared_ptr anEmpty; + return std::shared_ptr(new Model_ObjectDeletedMessage(anEmpty, "")); } const Events_ID Model_ObjectDeletedMessage::messageId() @@ -110,9 +112,19 @@ void Model_ObjectDeletedMessage::Join(const std::shared_ptr { std::shared_ptr aJoined = std::dynamic_pointer_cast(theJoined); - std::set::iterator aGIter = aJoined->myGroups.begin(); - for (; aGIter != aJoined->myGroups.end(); aGIter++) { - myGroups.insert(*aGIter); + + const std::list, std::string>>& aJGroups = + aJoined->groups(); + + std::list, std::string>>::iterator aGIter; + std::list, std::string>>::const_iterator aJIter; + for (aJIter = aJGroups.cbegin(); aJIter != aJGroups.cend(); aJIter++) { + for (aGIter = myGroups.begin(); aGIter != myGroups.end(); aGIter++) { + if (aGIter->first == aJIter->first && aGIter->second == aJIter->second) + break; // exists, so no need to insert + } + if (aGIter == myGroups.end()) + myGroups.push_back(*aJIter); } }