From fdd0dd4fc9c959616aa34b8761b3fa4a4f89b5b8 Mon Sep 17 00:00:00 2001 From: AlexBonazzi Date: Wed, 5 Dec 2018 14:56:20 +0100 Subject: [PATCH] Patch level : 12.0 652 Files correlati : cg1.exe sc2.exe Commento : Corretto un errore sui cursori nella stampa bilancio di verifica per clienti/fornitori e sulla stampa solleciti --- src/include/relation.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/include/relation.cpp b/src/include/relation.cpp index 8f1f81782..08c4c38f0 100755 --- a/src/include/relation.cpp +++ b/src/include/relation.cpp @@ -1184,6 +1184,8 @@ TRecnotype TCursor::buildcursor(TRecnotype rp) } _pagefirstpos = ap > _cmaxelpage ? -(_cmaxelpage + 1) : 0L ; + if (_pos < 0L) + _pos = 0L; return ap; } @@ -1748,9 +1750,11 @@ TRecnotype TCursor::readrec() } f.setstatus(NOERR); - if (_pos < _pagefirstpos || _pos >= _pagefirstpos + _cmaxelpage) + if (_pos < 0) + _pos = 0; + if (_pos < _pagefirstpos || _pos >= _pagefirstpos + _cmaxelpage) read_page(_pos / _cmaxelpage); - nrec = _page[_pos - _pagefirstpos]; + nrec = _page[_pos - _pagefirstpos]; CHECKD(nrec >= 0, "Bad record position ", nrec); curr().setdirty();