diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 48783552e..896598440 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -680,15 +680,17 @@ int TSpreadsheet::insert( // almeno 999 righe oppure se lo spreadsheet non e' attivo. { static bool ininsert = FALSE; - + + TMask & m = owner().mask(); if (ininsert || items() >= 999) return -1; - if (rec < 0 && items() > 0 && !owner().append() ) + if (m.is_running() && rec < 0 && items() > 0 && !owner().append() ) { XI_OBJ* itf = get_interface(); - XI_OBJ* focus = xi_get_focus(itf); - if (focus && focus->type == XIT_CELL) +// XI_OBJ* focus = xi_get_focus(itf); +// if (focus && focus->type == XIT_CELL) + if (m.focus_field().dlg() == owner().dlg()) rec = _cur_rec + 1; else rec = 0; @@ -1003,8 +1005,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) { if (test_focus_change()) { - owner().mask().notify_focus_field(owner().dlg()); insert(-1, TRUE, TRUE); + owner().mask().notify_focus_field(owner().dlg()); } } } @@ -1287,8 +1289,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) case K_CTRL+'+': if (test_focus_change()) { - owner().mask().notify_focus_field(owner().dlg()); insert(-1, TRUE, TRUE); + owner().mask().notify_focus_field(owner().dlg()); refused = TRUE; } break;