diff --git a/ba/ba1102.cpp b/ba/ba1102.cpp index 602d2419b..4cc9adb7c 100755 --- a/ba/ba1102.cpp +++ b/ba/ba1102.cpp @@ -58,34 +58,37 @@ bool TEdit_file::_browse(TCursor& cursor, const TFilename& name) cursor.freeze(TRUE); bool go = FALSE; bool first = FALSE; - int j; - for (j = 0, cursor = 0; j < sheet.items(); ++cursor, j++) + long j; + const long items = sheet.items(); + const long checked = sheet.checked(); + if (checked && yesno_box("Si desidera cancellare i %ld record indicati?", checked)) { - if (sheet.checked(j)) + begin_wait(); + for (j = 0, cursor = 0; j < items; j++) { - if (!go && !first) - go = yesno_box("Si desidera cancellare i %d record indicati?", sheet.checked()); - first = TRUE; - - if (!pind) + if (sheet.checked(j)) { - pind = new TProgind(sheet.checked(),"Attendere...", TRUE, TRUE, 32); - pind->addstatus(1); + if (!pind) + { + pind = new TProgind(sheet.checked(),"Attendere...", TRUE, TRUE, 32); + pind->addstatus(1); + } + else + { + if (pind->iscancelled()) break; + pind->addstatus(1); + } + + cursor = j; + cursor.file().remove(); + sheet.uncheck(j); } - else - { - if (pind->iscancelled()) break; - pind->addstatus(1); - } - - if (go) cursor.file().remove(); - sheet.uncheck(j); } + end_wait(); } if (pind) delete pind; cursor.freeze(FALSE); - if (first) { if (cursor.items() > 0) sheet.select(1);