]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #598
authorisn <isn@opencascade.com>
Tue, 23 Jun 2015 07:41:13 +0000 (10:41 +0300)
committerisn <isn@opencascade.com>
Tue, 23 Jun 2015 07:41:13 +0000 (10:41 +0300)
refs #595

src/HYDROGUI/HYDROGUI_ExportFileOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index f1fb2ed34978e715f5cabf16f3b8c64b30321e95..02483407f1cd784252eed68dca1c19b7e87ec0ed 100644 (file)
@@ -82,23 +82,28 @@ void HYDROGUI_ExportFileOp::startOperation()
   else
   {
     QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), "", aFilter, tr( "EXPORT_POLYLINE" ), false );
-    SHPHandle hSHPHandle;
-    if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
+    if (!aFileName.isEmpty())
     {
-      hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC );
-      for (int i = 1; i <= aPolyXYSeq.Size(); i++)
-        WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i));
+      SHPHandle hSHPHandle;
+      if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
+      {
+        hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC );
+        for (int i = 1; i <= aPolyXYSeq.Size(); i++)
+          WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i));
+      }
+      else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
+      {
+        hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ );
+        for (int i = 1; i <= aPoly3DSeq.Size(); i++)
+          WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i));
+      }      
+      SHPClose( hSHPHandle );
+      commit();
     }
-    else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
-    {
-      hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ );
-      for (int i = 1; i <= aPoly3DSeq.Size(); i++)
-        WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i));
-    }      
-    SHPClose( hSHPHandle );
+    else
+      abort();
   }
 
-  commit();
 }
 
 void HYDROGUI_ExportFileOp::WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly )
index ab66dc7f5ffe25771cb8ee9b587474d5221af742..f8e4a527edb17b47c82e3c56b76a2a49186aa984 100644 (file)
@@ -2222,6 +2222,13 @@ file cannot be correctly imported for an Obstacle definition.</translation>
     </message>
   </context>
 
+  <context>
+    <name>HYDROGUI_ExportFileOp</name>
+    <message>
+      <source>EXPORT_POLYLINE</source>
+      <translation>Export polyline</translation>
+    </message>
+  </context>
    
   <context>
     <name>HYDROGUI_GeoreferencementDlg</name>