Salome HOME
Methods to work with imagw references:
[modules/hydro.git] / src / HYDROData / HYDROData_Region.cxx
index 40d193b575b7cedd1e4050fa1d31caed30764211..6e0a0f1dee206324c3076569d210535444abbc5c 100644 (file)
@@ -26,7 +26,7 @@ QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjec
 {
   QStringList aResList;
 
-  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
+  Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
   if ( aDocument.IsNull() )
     return aResList;
 
@@ -73,8 +73,11 @@ bool HYDROData_Region::AddZone( const Handle(HYDROData_Zone)& theZone )
 
     theZone->SetLabel( aNewZone->Label() );
   }
+  else
+  {
+    AddReferenceObject( theZone, DataTag_Zone );
+  }
 
-  AddReferenceObject( theZone, DataTag_Zone );
   return true;
 }