Salome HOME
Fix for bug NPAL14907(EDF 368 : AddToStudy and GetName).
authormzn <mzn@opencascade.com>
Fri, 16 Feb 2007 09:23:11 +0000 (09:23 +0000)
committermzn <mzn@opencascade.com>
Fri, 16 Feb 2007 09:23:11 +0000 (09:23 +0000)
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOM_I/GEOM_Gen_i.cc

index 26e8a3776faf14f36078bda40dfd0da4e11347f5..c42e6c700580f8f65b52726db358ff47045886f4 100644 (file)
@@ -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));
 
index 94c92abfc2b8f69d2ca66a6a52d4a3748b693f1d..5ef3c018862fcacd1759c218443b1128fdd6dfd2 100644 (file)
@@ -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<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false );
              }
            } // if ( name attribute )
index a5e9c2e54294316abad7489ddc87f2b112685ec4..47e502f58c9e2faab87f348c8b390bf630e2cfe3 100644 (file)
@@ -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();
 }