From 93d31cbd5fd75e77da1764dc5510036c3d1c5b1c Mon Sep 17 00:00:00 2001
From: guy <guy@c028cbd2-c16b-5b4b-a496-9718f37d4682>
Date: Wed, 10 Jul 1996 07:18:26 +0000
Subject: [PATCH] Corretta gestione della cancellazione di tuute le righe di un
 file

git-svn-id: svn://10.65.10.50/trunk@3174 c028cbd2-c16b-5b4b-a496-9718f37d4682
---
 ba/ba1102.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/ba/ba1102.cpp b/ba/ba1102.cpp
index bce249b3c..6d1d556ec 100755
--- a/ba/ba1102.cpp
+++ b/ba/ba1102.cpp
@@ -80,8 +80,7 @@ bool TEdit_file::browse(int logicnum, const TFilename& name, const TString& tab)
 
           if (!pind)
           {
-            pind = new TProgind(sheet.checked(),"Attendere...",
-                                TRUE, TRUE, 32);
+            pind = new TProgind(sheet.checked(),"Attendere...", TRUE, TRUE, 32);
             pind->addstatus(1);
           }
           else 
@@ -97,10 +96,18 @@ bool TEdit_file::browse(int logicnum, const TFilename& name, const TString& tab)
       if (pind) delete pind;
       cursor.freeze(FALSE);
       
-      if (first) {sheet.select(1); continue;}
+      if (first) 
+      {            
+        if (cursor.items() > 0)
+          sheet.select(1);
+        continue;
+      }
     }
     if (ch == K_ENTER || ch == K_DEL) 
-      cursor = sheet.selected();
+    { 
+      if (cursor.items() > 0)
+        cursor = sheet.selected();
+    }  
     
     switch(ch)
     {