Inibita stampa sotto WIndows se non ci sono righe da stampare

git-svn-id: svn://10.65.10.50/trunk@613 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-11-14 11:50:54 +00:00
parent ac126ba3c0
commit 03ab8b79c0
2 changed files with 5 additions and 6 deletions

View File

@ -1382,18 +1382,16 @@ void TPrinter::close ()
if (_printertype == screenvis)
{
CHECK (_vf, "VF!");
_vf->close_print ();
_vf->close_print();
_vf->run ();
if (_vf->is_open ())
_vf->close_modal ();
if (_vf->is_open ()) _vf->close_modal ();
delete _vf;
freeze (FALSE);
_vf = NULL;
}
else if (_printertype == export)
{
if (!_exportfile.empty())
if (!_exportfile.empty() && _txt.lines() > 0L)
{
ofstream txt((const char*)_exportfile);
for (long i = 0; i < _txt.lines(); i++)
@ -1404,7 +1402,7 @@ void TPrinter::close ()
}
}
#if XVT_OS == XVT_OS_WIN
else if (_printertype == winprinter)
else if (_printertype == winprinter && _txt.lines() > 0L)
{
PrintWhat._prcd = _print_rcd;
PrintWhat._txt = &_txt;

View File

@ -128,6 +128,7 @@ public:
void close_print();
bool frozen() { return _frozen; }
void abort_print();
long lines() { return _txt.lines(); }
void add_line(const char* l);