From 94292c277056651c426d4c53695ecc414cf26b8a Mon Sep 17 00:00:00 2001 From: mzn Date: Fri, 16 Feb 2007 09:23:11 +0000 Subject: [PATCH] Fix for bug NPAL14907(EDF 368 : AddToStudy and GetName). --- src/GEOMToolsGUI/GEOMToolsGUI.cxx | 1 - src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 4 ++++ src/GEOM_I/GEOM_Gen_i.cc | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index 26e8a3776..c42e6c700 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -459,7 +459,6 @@ bool GEOMToolsGUI::Import() anObj = aInsOp->Import(fileN, fileT); if ( !anObj->_is_nil() && aInsOp->IsDone() ) { - anObj->SetName(GEOMBase::GetDefaultName(QObject::tr("GEOM_IMPORT")).latin1()); QString aPublishObjName = GEOMBase::GetDefaultName(SUIT_Tools::file(fileName, /*withExten=*/true)); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 94c92abfc..5ef3c0188 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -202,6 +202,10 @@ void GEOMToolsGUI::OnRename() if ( !newName.isEmpty() ) { aName->SetValue( newName.latin1() ); // rename the SObject 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(app->activeModule()))->updateObjBrowser( false ); } } // if ( name attribute ) diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index a5e9c2e54..47e502f58 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -272,6 +272,9 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeName"); SALOMEDS::AttributeName_var aNameAttrib = SALOMEDS::AttributeName::_narrow(anAttr); aNameAttrib->SetValue(aShapeName.ToCString()); + + //Set a name of the GEOM object + aShape->SetName(theName); return aResultSO._retn(); } -- 2.39.2