From fe45e07a1446c0f2bdcf547723ae3818c68115cd Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 17 Oct 2005 10:27:05 +0000 Subject: [PATCH] Patch level : 2.2 Files correlati : form Ricompilazione Demo : [ ] Commento : Sostituite ripetute chiamate al metodo cursor() con un'unica variabile git-svn-id: svn://10.65.10.50/trunk@13427 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/form.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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++; }