diff --git a/at/at1500.cpp b/at/at1500.cpp index aace39020..27b32f107 100755 --- a/at/at1500.cpp +++ b/at/at1500.cpp @@ -163,7 +163,7 @@ void TControlloBenemerenze::set_page(int file, int cnt) bool TControlloBenemerenze::filter_func_ctrlben(const TRelation* rel) { - bool filtrato = FALSE; + bool filtrato = false; TLocalisamfile& sog = rel->lfile(); // filtro per categorie donatori TAssoc_array& categorie = app()._catdon; @@ -174,14 +174,14 @@ bool TControlloBenemerenze::filter_func_ctrlben(const TRelation* rel) } // se non ho selezionato categorie il soggetto va filtrato comunque if (app()._catdon.items() == 0) - filtrato = TRUE; + filtrato = true; // filtro per iniziale cognome if (filtrato && (!app()._lettini.blank()) && (!app()._lettfin.blank())) { TString80 cognome = sog.get(SOG_COGNOME); TString16 primalett = cognome.left(15); if (!(primalett >= app()._lettini && primalett <= app()._lettfin)) - filtrato = FALSE; + filtrato = false; } return filtrato; } @@ -219,7 +219,10 @@ bool TControlloBenemerenze::preprocess_page(int file, int counter) TRectype* key = new TRectype(LF_BENEM); key->put(BEN_CODICE,codice); const int err = _sbenemerenze->read(key); - for (int r=1; r<=_sbenemerenze->rows(); r++) + const int items = _sbenemerenze->rows(); + if (items <= 0) + return false; + for (int r=1; r<=items; r++) { const TRectype& riga = _sbenemerenze->row(r); const TString16 tipoben = riga.get(BEN_TIPOBEN); @@ -265,7 +268,7 @@ bool TControlloBenemerenze::preprocess_page(int file, int counter) if (printer().rows_left()<2) printer().formfeed(); _contatore++; - return TRUE; + return true; } bool TControlloBenemerenze::set_print(int m) @@ -312,7 +315,7 @@ bool TControlloBenemerenze::set_print(int m) if (sotfin.not_empty()) a.put(SOG_CODSOT, sotfin); current_cursor()->setregion(da, a); - current_cursor()->setfilter(filtro, TRUE); + current_cursor()->setfilter(filtro, true); ((TSorted_cursor*)current_cursor())->change_order(chiave); reset_files(); add_file(LF_SOGGETTI); @@ -339,10 +342,10 @@ bool TControlloBenemerenze::set_print(int m) reset_print(); printer().footerlen(0); crea_intestazione(); - return TRUE; + return true; } else - return FALSE; + return false; } void TControlloBenemerenze::crea_intestazione() @@ -379,7 +382,7 @@ bool TControlloBenemerenze::user_create() _colonne = new TAssoc_array(); add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ","",3)); _msk = new TMask("at1500a"); - return TRUE; + return true; } bool TControlloBenemerenze::user_destroy() @@ -389,7 +392,7 @@ bool TControlloBenemerenze::user_destroy() delete _sbenemerenze; delete _benem; delete _rel; - return TRUE; + return true; } int at1500(int argc, char* argv[])