diff --git a/include/printer.cpp b/include/printer.cpp index c0d1b530f..22f17b6c1 100755 --- a/include/printer.cpp +++ b/include/printer.cpp @@ -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; diff --git a/include/viswin.h b/include/viswin.h index 1c1756597..82c411ffd 100755 --- a/include/viswin.h +++ b/include/viswin.h @@ -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);