]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Import of landcover: small bug fixes
authorisn <isn@opencascade.com>
Mon, 29 Jun 2015 11:42:41 +0000 (14:42 +0300)
committerisn <isn@opencascade.com>
Mon, 29 Jun 2015 11:42:41 +0000 (14:42 +0300)
src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx

index ef7756b15720b2be003a86871067a96a3eca9395..bbf23d2fd7f4cba6face91aac926430ddeab8b0b 100644 (file)
@@ -215,18 +215,17 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected()
     TopTools_SequenceOfShape aFaces;
     HYDROData_ShapeFile anImporter;
 
-    if (anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces))
-    {
-      aPanel->setPolygonNames(aPolygonsList);
+    SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
+    if ( !aStudy )
+      return;
 
-      SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
-      if ( !aStudy ) {
-        return;
-      }
+    erasePreview();
 
-      erasePreview();
+    Handle(AIS_InteractiveContext) aCtx = NULL;
 
-      Handle(AIS_InteractiveContext) aCtx = NULL;
+    if (anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces))
+    {
+      aPanel->setPolygonNames(aPolygonsList);
 
       LightApp_Application* anApp = module()->getApp();
       if ( !getPreviewManager() )
@@ -276,7 +275,8 @@ void HYDROGUI_ImportLandCoverOp::onFileSelected()
       SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), "Cannot import land cover;\nThe shape type is not polygon" );
         
       QApplication::restoreOverrideCursor();
-      abort();
+      commitDocOperation();
+      //abort();
     }
     anImporter.Free();