diff --git a/ve/velib06a.cpp b/ve/velib06a.cpp index 632a2454b..2d17920af 100755 --- a/ve/velib06a.cpp +++ b/ve/velib06a.cpp @@ -573,28 +573,24 @@ bool tipo_riga_handler(TMask_field& f, KEY key) { const int curr_row = sf->selected(); TToken_string & row = sf->row(curr_row); - const int col = sf->cid2index(FR_TIPORIGA); - const TString16 old_tipo_riga = row.get(col); + const TString16 old_tipo_riga = docmask.doc()[curr_row + 1].get(RDOC_TIPORIGA); const TString16 tipo_riga = f.get(); - if (!row_mask.is_running()) + if (old_tipo_riga != tipo_riga) { - if (old_tipo_riga != tipo_riga) + if (!row_mask.is_running()) { - row.add(tipo_riga, col); docmask.doc()[curr_row + 1].set_tipo(tipo_riga); - TMask * rm = docmask.riga_mask(curr_row); sf->post_insert(curr_row); sf->check_row(curr_row); sf->force_update(curr_row); } - } - else - if (old_tipo_riga != tipo_riga) + else { f.set(old_tipo_riga); - return error_box("Impossibile cambiare il tipo nella maschera di riga"); + return f.error_box("Impossibile cambiare il tipo nella maschera di riga"); } + } } } }