diff --git a/include/maskfld.cpp b/include/maskfld.cpp index f80e39650..03e09c707 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -3046,7 +3046,7 @@ bool TList_field::on_key(KEY key) { if (key >= '0' && key <= 'z') { - const int index = xvt_list_get_sel_index(win()); + const int index = current(); CHECK(index >= 0, "List with no selection!"); int newindex = -1; @@ -3088,13 +3088,16 @@ bool TList_field::on_key(KEY key) } if (newindex >= 0) - { - xvt_list_suspend(win()); - xvt_list_set_sel(win(), index, FALSE); - xvt_list_set_sel(win(), newindex, TRUE); - xvt_list_resume(win()); - } - } // alphanumeric + current(newindex); + /* + { + xvt_list_suspend(win()); + xvt_list_set_sel(win(), index, FALSE); + xvt_list_set_sel(win(), newindex, TRUE); + xvt_list_resume(win()); + } + */ + } #if XVTWS == VMWS if (key == K_TAB && class_id() == CLASS_LIST_FIELD) diff --git a/include/relation.cpp b/include/relation.cpp index 082c5f701..e719e93ec 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1,4 +1,4 @@ -// $Id: relation.cpp,v 1.50 1995-07-03 07:49:22 angelo Exp $ +// $Id: relation.cpp,v 1.51 1995-07-06 15:22:26 guy Exp $ // relation.cpp // fv 12/8/93 // relation class for isam files @@ -1422,6 +1422,7 @@ bool TRecord_array::renum_key(const char* field, const TString& num) bool TRecord_array::renum_key(const char* field, long num) { + CHECKS(num > 0, "Null key value for field: ", field); TString16 n; n << num; return renum_key(field, n); } @@ -1493,12 +1494,23 @@ int TRecord_array::write(bool re) const TRectype* r = (TRectype*)objptr(i); if (r != NULL) - { - err = re ? f.rewrite(*r) : f.write(*r); - if (err != NOERR) - err = re ? f.write(*r) : f.rewrite(*r); - if (err != NOERR) - break; + { + if (re) + { + err = f.rewrite(*r); + if (err == _iskeynotfound || err == _iseof || err == _isemptyfile) + err = f.write(*r); + if (err != NOERR) + break; + } + else + { + err = f.write(*r); + if (err == _isreinsert) + err = f.rewrite(*r); + if (err != NOERR) + break; + } } else { @@ -1513,7 +1525,7 @@ int TRecord_array::write(bool re) } } - if (err == NOERR) + if (re && err == NOERR) { // Cancella eventuali residui successivi f.curr() = key(); f.put(_num, i + _offset);