diff --git a/sc/sc2100.cpp b/sc/sc2100.cpp index 2b38158f9..4019df8c0 100755 --- a/sc/sc2100.cpp +++ b/sc/sc2100.cpp @@ -63,8 +63,9 @@ protected: static void ec_header_handler(TPrinter& p); static void ec_footer_handler(TPrinter& p); - + public: + TTotalizer& totali() { return _totali; } TDecoder& causali() { return _causali; } TDecoder& valute() { return _valute; } @@ -966,7 +967,7 @@ void TEC_form::ultima_pagina() void TEC_form::ec_header_handler(TPrinter& pr) { pr.resetheader(); - _form->stampa_testata(pr); + _form->stampa_testata(pr); } void TEC_form::ec_footer_handler(TPrinter& pr) @@ -1011,19 +1012,22 @@ bool TEC_form::print_game(const TPartita& game) { TEC_row& riga = righe.row(r); - if (pr.rows_left() < body.height()) + int a = pr.rows_left(); /* dbg */ + int b = body.height(); /* dbg */ + + if (pr.rows_left() <= (body.height()+1)) // salto pagina { pr.formfeed(); for (word nr = 0; nr < _num_rip; nr++) - { + { TPrintrow* fl = pr.getfooterline(nr + 1); CHECKD(fl, "Manca la riga di riporto ", nr + 1); pr.print(*fl); - } + } } - + const int ri = riga.riga(); - const int ra = riga.rata(); + const int ra = riga.rata(); if (ri == ultima_riga && ra == ultima_rata+1) riga.reset_uguali(); ultima_riga = ri; @@ -1161,7 +1165,7 @@ TEC_form::TEC_form(const TEC_mask& m, bool gesval) // La prima e l'ultima riga del footer devono essere lasciate libere per la fincatura // Ogni totale occupa _total_rows righe: per cui posso calcolare il massimo di totali // che posso stampare nel footer. - const word max = (foot.height() - 2) / _total_rows; + const word max = (foot.height() - 2) / _total_rows; if (_maxtot <= 0 || _maxtot > max) _maxtot = max; }