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
This commit is contained in:
guy 2005-10-17 10:27:05 +00:00
parent fec0c8c76a
commit fe45e07a14

View File

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