Ulteriori modifive al commit precedente

git-svn-id: svn://10.65.10.50/trunk@2814 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-05-14 10:30:50 +00:00
parent 6f31f4d013
commit a7011674fe

View File

@ -1905,18 +1905,18 @@ int TRecord_array::rec2row(const TRectype& r) const
int TRecord_array::insert_row(TRectype* r) int TRecord_array::insert_row(TRectype* r)
{ {
const int nr = rec2row(*r); const int nr = rec2row(*r);
CHECK(nr, "You cannot insert a new key"); CHECK(nr > 0, "You cannot insert a new key");
const bool shift = exist(nr); const bool shift = exist(nr);
insert(r, nr); insert(r, nr);
if (shift) // Se ho cambiato il record campione if (shift)
{ // e ci sono altre righe ... {
for (int f = last(); f > nr; f--) for (int f = last(); f > nr; f = pred(f))
{ {
char n[16]; char n[16];
TRectype & rec = row(f, FALSE); TRectype & rec = row(f, FALSE);
sprintf(n, "%ld", (long)_offset + f); sprintf(n, "%ld", (long)_offset + f);
rec.put(_num, n); renum_key(_num, n);
} }
} }
return nr; return nr;