From ac0dea7aeb5f4babd65e04c0c04d5759fa89a05b Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 16 Jun 2006 09:21:24 +0000 Subject: [PATCH] PAL12611. Perfected fix. --- src/LightApp/LightApp_SelectionMgr.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/LightApp/LightApp_SelectionMgr.cxx b/src/LightApp/LightApp_SelectionMgr.cxx index 0a5f0aaaf..ca18b5759 100644 --- a/src/LightApp/LightApp_SelectionMgr.cxx +++ b/src/LightApp/LightApp_SelectionMgr.cxx @@ -73,7 +73,7 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QStri QMap entryMap; - QString entry; + QString entry, checkEntry; for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) { const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); @@ -85,9 +85,14 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QStri return; entry = owner->entry(); + // Entry to check object uniqueness. + // It is selected owner entry in the case, when we do not convert references, + // and entry of a real object, when we convert references. + checkEntry = entry; if ( convertReferences ) { QString refEntry = study->referencedToEntry( entry ); - if ( !entryMap.contains( entry ) && !entryMap.contains( refEntry ) ) { + checkEntry = refEntry; + if ( !entryMap.contains( checkEntry ) ) { if ( refEntry != entry ) { QString component = study->componentDataType( refEntry ); theList.Append( new SALOME_InteractiveObject( refEntry, component, ""/*refobj->Name().c_str()*/ ) ); @@ -101,7 +106,7 @@ void LightApp_SelectionMgr::selectedObjects( SALOME_ListIO& theList, const QStri theList.Append( owner->IO() ); } - entryMap.insert(owner->entry(), 1); + entryMap.insert(checkEntry, 1); } } -- 2.39.2