From a7011674fe393d9c3e1bcf545a2f3453cfbfc2e7 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 14 May 1996 10:30:50 +0000 Subject: [PATCH] Ulteriori modifive al commit precedente git-svn-id: svn://10.65.10.50/trunk@2814 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/relation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/relation.cpp b/include/relation.cpp index d7927ef13..1fa4791aa 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -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;