Fix for bug NPAL14907(EDF 368 : AddToStudy and GetName).

This commit is contained in:
mzn 2007-02-16 09:23:11 +00:00
parent 57ff7bd09f
commit 94292c2770
3 changed files with 7 additions and 1 deletions

View File

@ -459,7 +459,6 @@ bool GEOMToolsGUI::Import()
anObj = aInsOp->Import(fileN, fileT); anObj = aInsOp->Import(fileN, fileT);
if ( !anObj->_is_nil() && aInsOp->IsDone() ) { if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
anObj->SetName(GEOMBase::GetDefaultName(QObject::tr("GEOM_IMPORT")).latin1());
QString aPublishObjName = QString aPublishObjName =
GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true)); GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true));

View File

@ -202,6 +202,10 @@ void GEOMToolsGUI::OnRename()
if ( !newName.isEmpty() ) { if ( !newName.isEmpty() ) {
aName->SetValue( newName.latin1() ); // rename the SObject aName->SetValue( newName.latin1() ); // rename the SObject
IObject->setName( newName.latin1() );// rename the InteractiveObject IObject->setName( newName.latin1() );// rename the InteractiveObject
// Rename the corresponding GEOM_Object
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
if (!CORBA::is_nil( anObj ))
anObj->SetName( newName.latin1() );
(dynamic_cast<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false ); (dynamic_cast<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false );
} }
} // if ( name attribute ) } // if ( name attribute )

View File

@ -272,6 +272,9 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName"); anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName");
SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr); SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr);
aNameAttrib->SetValue(aShapeName.ToCString()); aNameAttrib->SetValue(aShapeName.ToCString());
//Set a name of the GEOM object
aShape->SetName(theName);
return aResultSO._retn(); return aResultSO._retn();
} }