Patch level : 2.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Migliorato calcolo pagine da stampare


git-svn-id: svn://10.65.10.50/trunk@11134 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-05-15 09:51:23 +00:00
parent 7e7e4258cf
commit cc9fb00ff9
2 changed files with 11 additions and 5 deletions

View File

@ -199,6 +199,7 @@ struct TPrint_txt_info
word _copies;
word _pagefrom;
word _pageto;
word _lastpage;
bool edit();
TPrint_txt_info(TTextfile& txt);
@ -213,14 +214,16 @@ bool TPrint_txt_info::edit()
msk.set(F_SIZE, p.get_char_size());
msk.set(F_ISGRAPHICS, p.isgraphics() ? "X" : "");
msk.set(F_FROMPAGE, _pagefrom);
msk.set(F_TOPAGE, _pageto);
msk.set(F_TOPAGE, _lastpage);
msk.set(F_COPIES, _copies);
bool ok = msk.run() == K_ENTER;
const bool ok = msk.run() == K_ENTER;
if (ok)
{
_copies = msk.get_int(F_COPIES);
_pagefrom = msk.get_int(F_FROMPAGE);
_pageto = msk.get_int(F_TOPAGE);
if (_pageto < _pagefrom || _pageto >= _lastpage)
_pageto = 0;
}
return ok;
}
@ -228,9 +231,9 @@ bool TPrint_txt_info::edit()
TPrint_txt_info::TPrint_txt_info(TTextfile& txt)
: _txt(&txt), _copies(1), _pagefrom(1), _pageto(0)
{
const word ps = txt.page_size();
const word ps = printer().formlen();
const long li = txt.lines();
_pageto = (li+ps-1) / ps;
_lastpage = (li+ps-1) / ps;
}
BOOLEAN TPrinter::start_print(long data)

View File

@ -284,7 +284,10 @@ TTimerind::TTimerind(long msec, const char* txt,
}
TTimerind::~TTimerind()
{ xvt_timer_destroy(_timer_id); }
{
if (_timer_id != 0L)
xvt_timer_destroy(_timer_id);
}
// C-style binding
// uses static pointer for single instance of TIndwin