Salome HOME
Import profiles protection (Bug #203).
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.cxx
index 1b72cba377da9bb640b5b57621fd8f1f2e1423d4..198222ab62a76428d734c9c6163ba39374c9eb0f 100644 (file)
@@ -70,12 +70,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
       if ( aRegion.IsNull() )
         continue;
 
-      QString aRegionName = aRegion->GetName();
-      if ( aRegionName.startsWith( anOldCaseName ) )
-      {
-        aRegionName.replace( anOldCaseName, theName );
-        aRegion->SetName( aRegionName );
-      }
+      HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aRegion );
 
       HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
       HYDROData_SequenceOfObjects::Iterator anIter( aZones );
@@ -86,12 +81,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
         if ( aRegZone.IsNull() )
           continue;
 
-        QString aRegionZoneName = aRegZone->GetName();
-        if ( aRegionZoneName.startsWith( anOldCaseName ) )
-        {
-          aRegionZoneName.replace( anOldCaseName, theName );
-          aRegZone->SetName( aRegionZoneName );
-        }
+        HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aRegZone );
       }
     }
 
@@ -105,12 +95,7 @@ void HYDROData_CalculationCase::SetName( const QString& theName )
       if ( aGroup.IsNull() )
         continue;
 
-      QString aGroupName = aGroup->GetName();
-      if ( aGroupName.startsWith( anOldCaseName ) )
-      {
-        aGroupName.replace( anOldCaseName, theName );
-        aGroup->SetName( aGroupName );
-      }
+      HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aGroup );
     }
   }