diff --git a/include/form.cpp b/include/form.cpp index d80c17235..9c3144037 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -3406,10 +3406,10 @@ void TForm::arrange_form() printer().set_offset(-(_ipy-1), printer().get_column_offset()); */ } - long TForm::records() const { - const long r = cursor() ? cursor()->items() : 0; + TCursor* c = cursor(); + const long r = c != NULL ? c->items() : 0; return r; } @@ -3755,6 +3755,7 @@ bool TForm::print( // if (to == lastrec) to--; // l'ultima pagina è gestita come caso particolare bool ok = TRUE; + TCursor* cur = cursor(); for (long i = from; i <= to && ok;) { @@ -3763,9 +3764,9 @@ bool TForm::print( if (from < 0) to = from; - else if (cursor()) + else if (cur != NULL) { - *cursor()=i; + *cur = i; match_result(); } @@ -3783,9 +3784,9 @@ bool TForm::print( set_last_page(TRUE); set_background(0, TRUE); set_header(0, TRUE); - if (cursor()) + if (cur != NULL) { - *cursor() = i; + *cur = i; set_body(0, TRUE); } i++; @@ -3796,10 +3797,10 @@ bool TForm::print( } set_body(page(pr), TRUE); - if (cursor()) + if (cur != NULL) { if (next_match_done()) - i=cursor()->pos(); + i=cur->pos(); else i++; }