diff --git a/include/printwin.cpp b/include/printwin.cpp index 06a50d2dc..23dae4ab8 100755 --- a/include/printwin.cpp +++ b/include/printwin.cpp @@ -343,25 +343,25 @@ bool TPrintwin::do_print() _frlc = 0; _blank_lines_to_print = 0; - int page = 0; - bool ok = TRUE; - while (ok && !_aborted) + bool finished = FALSE; + for (int page = 0; !finished && !_aborted; page++) { _aborted = xvt_print_open_page(_printrcd) == 0; - while (!_aborted && ok) + if (!_aborted) { - const RCT* rct = xvt_print_get_next_band(); - ok = rct != NULL; - if (ok) + for (const RCT* rct = xvt_print_get_next_band(); rct != NULL; rct = xvt_print_get_next_band()) { set_font(XVT_FFN_SYSTEM, XVT_FS_NONE, _char_size); // ??? set_font(printer().fontname(), XVT_FS_NONE, _char_size); LEN_SPACES(win(), -1); // Resetta bene le dimensioni font - ok = print_band(page, *rct); + if (!print_band(page, *rct)) + { + finished = TRUE; + break; + } } + _aborted = xvt_print_close_page(_printrcd) == 0; } - _aborted |= (xvt_print_close_page(_printrcd) == 0); - page++; } return !_aborted;