]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #595: error in split/merge polylines GUI
authorasl <asl@opencascade.com>
Mon, 22 Jun 2015 12:37:13 +0000 (15:37 +0300)
committerasl <asl@opencascade.com>
Mon, 22 Jun 2015 12:37:13 +0000 (15:37 +0300)
src/HYDROGUI/HYDROGUI_ObjComboBox.cxx
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx
src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 13c88f0555db8f0c8f7a453f594fefefa3571c44..9b2dfc7a836291facb3d9d3806d3e70744c8ea2a 100644 (file)
@@ -164,6 +164,6 @@ Handle( HYDROData_Entity ) HYDROGUI_ObjComboBox::GetObject() const
   if( anIndex>=0 && anIndex<myObjects.Length() )
     return myObjects.Value( myObjects.Lower() + anIndex );
   else
-    Handle( HYDROData_Entity )();
+    return Handle( HYDROData_Entity )();
 }
 
index 6fe879871c1bc44a0548f47977d5d4f5f6ebbd59..ddc5d0b3ffed5fee408f4c1069376a4035a1fa16 100644 (file)
@@ -108,12 +108,15 @@ Handle( HYDROData_PolylineXY ) HYDROGUI_SplitPolylinesDlg::GetMainPolyline() con
   switch( GetMode() )
   {
   case ByPoint:
-    return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline1->GetObject() );
+    if( !myMainPolyline1->GetObject().IsNull() )
+      return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline1->GetObject() );
   case ByTool:
-    return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline2->GetObject() );
+    if( !myMainPolyline2->GetObject().IsNull() )
+      return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline2->GetObject() );
   default:
     return Handle( HYDROData_PolylineXY )();
   }
+  return Handle( HYDROData_PolylineXY )();
 }
 
 Handle( HYDROData_PolylineXY ) HYDROGUI_SplitPolylinesDlg::GetToolPolyline() const
index afb40918ae12b7abb5dd77a85f50c5cd1a569e74..73f415a8957783ee7e0e6d81bb8eef3f32855fb4 100644 (file)
@@ -152,14 +152,17 @@ void HYDROGUI_SplitPolylinesOp::OnUpdatePreview()
       {
         gp_Pnt2d aPnt = aPanel->GetPoint();
         TopoDS_Vertex aVertex = BRepLib_MakeVertex( gp_Pnt( aPnt.X(), aPnt.Y(), 0.0 ) );
-        aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() );
+        if( !aPanel->GetMainPolyline().IsNull() )
+          aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() );
         aBB.Add( aCmp, aVertex );
         break;
       }
     case HYDROGUI_SplitPolylinesDlg::ByTool:
       {
-        aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() );
-        aBB.Add( aCmp, aPanel->GetToolPolyline()->GetShape() );
+        if( !aPanel->GetMainPolyline().IsNull() )
+          aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() );
+        if( !aPanel->GetToolPolyline().IsNull() )
+          aBB.Add( aCmp, aPanel->GetToolPolyline()->GetShape() );
         break;
       }
     case HYDROGUI_SplitPolylinesDlg::Split:
index 41707773a0fbb28265aaee5a347065417ba7d185..ab66dc7f5ffe25771cb8ee9b587474d5221af742 100644 (file)
@@ -2878,6 +2878,14 @@ Polyline should consist from one not closed curve.</translation>
     </message>
   </context>
 
+  <context>
+    <name>HYDROGUI_SplitPolylinesOp</name>
+    <message>
+      <source>SPLIT_POLYLINES</source>
+      <translation>Split polylines</translation>
+    </message>
+  </context>
+
   <context>
     <name>HYDROGUI_SplitPolylinesDlg</name>
     <message>
@@ -2926,6 +2934,14 @@ Polyline should consist from one not closed curve.</translation>
     </message>
   </context>
 
+  <context>
+    <name>HYDROGUI_MergePolylinesOp</name>
+    <message>
+      <source>MERGE_POLYLINES</source>
+      <translation>Merge polylines</translation>
+    </message>
+  </context>
+
   <context>
     <name>HYDROGUI_ObjListBox</name>
     <message>