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)
{
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);
insert(r, nr);
if (shift) // Se ho cambiato il record campione
{ // e ci sono altre righe ...
for (int f = last(); f > nr; f--)
if (shift)
{
for (int f = last(); f > nr; f = pred(f))
{
char n[16];
TRectype & rec = row(f, FALSE);
sprintf(n, "%ld", (long)_offset + f);
rec.put(_num, n);
renum_key(_num, n);
}
}
return nr;