Salome HOME
Merge branch 'master' of https://git.salome-platform.org/git/modules/hydro
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ExportFileOp.cxx
index e4bb9ee959583d878ea8776ff90f1553773baa8a..b256ba4f28d70a4b9376bde57cff4aef3c63ecd7 100644 (file)
@@ -131,10 +131,12 @@ void HYDROGUI_ExportFileOp::startOperation()
         else
           return; 
 
+        QStringList SortedListOfAttr = anAttrNames.toList();
+        SortedListOfAttr.sort();
         //
         Handle_HYDROData_LandCoverMap aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) );
         bool IsLinear = aLCM->CheckLinear();
-        HYDROGUI_ExportLandCoverMapDlg aDlg( module()->getApp()->desktop(), IsLinear, anAttrNames.toList());
+        HYDROGUI_ExportLandCoverMapDlg aDlg( module()->getApp()->desktop(), IsLinear, SortedListOfAttr);
         if ( aDlg.exec() == HYDROGUI_ExportLandCoverMapDlg::Accepted )
         { 
           //In our case :  aSeq.Size() == 1
@@ -157,7 +159,7 @@ void HYDROGUI_ExportFileOp::startOperation()
           //Even if attribute-checkbox is unchecked, the .dbf-file should be removed. 
           //otherwise it may be used with wrong .shp-file. This is an incorrect behaivor.
           remove (aDBFFileName.toStdString().c_str());
-          bool bToSaveAttrInfo = aDlg.getAttrCheckBoxState();
+          bool bToSaveAttrInfo = aDlg.getAttrCheckBoxState() && !aDlg.getCurrentItem().isEmpty();
           if (bToSaveAttrInfo)
           {
             //export attribute info