diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index f76cbb0d3..d2aedf727 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -219,8 +219,9 @@ int GEOMBase::GetNameOfSelectedIObjects( const SALOME_ListIO& aList, { GEOM::ListOfGO anObjs; ConvertListOfIOInListOfGO( aList, anObjs, theShapesOnly ); - if ( anObjs.length() == 1 ) + if ( anObjs.length() == 1 ) { theName = GetName( anObjs[ 0 ] ); + } else theName = QString( "%1_objects" ).arg( anObjs.length() ); @@ -946,7 +947,7 @@ bool GEOMBase::GetShape( const GEOM::GEOM_Object_ptr& theObject, TopoDS_Shape& t // function : GetName() // purpose : Get name of object //======================================================================= -const char* GEOMBase::GetName( GEOM::GEOM_Object_ptr theObj ) +QString GEOMBase::GetName( GEOM::GEOM_Object_ptr theObj ) { SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); @@ -962,45 +963,15 @@ const char* GEOMBase::GetName( GEOM::GEOM_Object_ptr theObj ) if ( aSObj && aSObj->FindAttribute( anAttr, "AttributeName") ) { _PTR(AttributeName) aNameAttr ( anAttr ); - return aNameAttr->Value().c_str(); + return QString( aNameAttr->Value().c_str() ); } } } - return ""; + return QString(""); } bool GEOMBase::IsShape( GEOM::GEOM_Object_ptr theObj ) { return !theObj->_is_nil() && theObj->IsShape(); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/GEOMBase/GEOMBase.h b/src/GEOMBase/GEOMBase.h index 018c5c259..e26eacab1 100644 --- a/src/GEOMBase/GEOMBase.h +++ b/src/GEOMBase/GEOMBase.h @@ -128,7 +128,7 @@ public : static void ShowErrorMessage(const char* theErrorCode, const char* theComment = 0); /* Gets name of object */ - static const char* GetName( GEOM::GEOM_Object_ptr ); + static QString GetName( GEOM::GEOM_Object_ptr ); static bool IsShape( GEOM::GEOM_Object_ptr theObj ); };