diff --git a/src/sc/scselect.cpp b/src/sc/scselect.cpp index 7a53cdd53..57d35202b 100755 --- a/src/sc/scselect.cpp +++ b/src/sc/scselect.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "scselect.h" #include "sc2400a.h" #include "sc2400b.h" @@ -1891,49 +1892,53 @@ bool TSelection_mask::on_field_event(TOperable_field& o, TField_event e, long jo mail.load(); sh.reset(); update_checked(); - + const int last = s.last_one(); - for (long pos = s.first_one(); pos <= last; pos++) { - fc = pos; + TProgind p(s.items(), "Selezione"); - const TRectype & cli = fc.curr(); - const TString & tipo = cli.get(CLI_TIPOCF); - const long codice = cli.get_long(CLI_CODCF); - - if (s.checked(pos) && some_to_print(tipo, codice)) + for (long pos = s.first_one(); p.addstatus() && pos <= last; pos++) { - TString ragsoc = cli.get(CLI_RAGSOC); - TToken_string email; - - for (int i = 1; email.blank() && i <= 3; i++) + fc = pos; + + const TRectype & cli = fc.curr(); + const TString & tipo = cli.get(CLI_TIPOCF); + const long codice = cli.get_long(CLI_CODCF); + + if (s.checked(pos) && some_to_print(tipo, codice)) { - const char order = ini_get_string(CONFIG_USER, "Mail", "Email", "", i)[0]; + TString ragsoc = cli.get(CLI_RAGSOC); + TToken_string email; - switch (order) + for (int i = 1; email.blank() && i <= 3; i++) { - case 'P': - email = cli.get(CLI_PEC); - break; - case 'N': - email = cli.get(CLI_MAIL); - break; - case 'D': - email = cli.get(CLI_DOCMAIL); - break; - default: - break; + const char order = ini_get_string(CONFIG_USER, "Mail", "Email", "", i)[0]; + + switch (order) + { + case 'P': + email = cli.get(CLI_PEC); + break; + case 'N': + email = cli.get(CLI_MAIL); + break; + case 'D': + email = cli.get(CLI_DOCMAIL); + break; + default: + break; + } } + + const int nrow = sh.set_row_cell(S_SELECTED, email.full()); + + sh.enable_cell(nrow, S_SELECTED, email.full()); + sh.set_row_cell(S_CODCF, cli.get_long(CLI_CODCF), nrow); + sh.set_row_cell(S_EMAIL, email, nrow); + ragsoc.strip_double_spaces(); + sh.set_row_cell(S_RAGSOC, ragsoc, nrow); } - - const int nrow = sh.set_row_cell(S_SELECTED, email.full()); - - sh.enable_cell(nrow, S_SELECTED, email.full()); - sh.set_row_cell(S_CODCF, cli.get_long(CLI_CODCF), nrow); - sh.set_row_cell(S_EMAIL, email, nrow); - ragsoc.strip_double_spaces(); - sh.set_row_cell(S_RAGSOC, ragsoc, nrow); } } sh.sort(sort);