diff --git a/include/printapp.cpp b/include/printapp.cpp index ad9f2e4e7..d49175b3f 100755 --- a/include/printapp.cpp +++ b/include/printapp.cpp @@ -1,4 +1,4 @@ -// $Id: printapp.cpp,v 1.15 1994-11-11 11:23:16 villa Exp $ +// $Id: printapp.cpp,v 1.16 1994-12-02 10:48:30 villa Exp $ #include #include @@ -16,20 +16,20 @@ const char *printf_types = "dDiIuUoOxXfeEgGcCnNsSpPrRtT"; // _FieldTok flags -const word LONG_FLAG = 0x0001; +const word LONG_FLAG = 0x0001; const word PICTURE_FLAG = 0x0002; -const word PAD_FLAG = 0x0004; -const word ALIGN_FLAG = 0x0008; -const word TRANS_FLAG = 0x0010; -const word DATE_FLAG = 0x0020; -const word STRING_FLAG = 0x0040; -const word NUMBER_FLAG = 0x0080; -const word DEC_FLAG = 0x0100; -const word FONT_FLAG = 0x0200; -const word JUMP_FLAG = 0x0400; -const word RECNO_FLAG = 0x0800; +const word PAD_FLAG = 0x0004; +const word ALIGN_FLAG = 0x0008; +const word TRANS_FLAG = 0x0010; +const word DATE_FLAG = 0x0020; +const word STRING_FLAG = 0x0040; +const word NUMBER_FLAG = 0x0080; +const word DEC_FLAG = 0x0100; +const word FONT_FLAG = 0x0200; +const word JUMP_FLAG = 0x0400; +const word RECNO_FLAG = 0x0800; const word BOOLEAN_FLAG = 0x1000; -const word IGNORE_FILL = 0x2000; +const word IGNORE_FILL = 0x2000; // ============================================================= // print token containers @@ -469,6 +469,19 @@ void TPrint_application::fill_page (int from) } } +void TPrint_application::merge_export_file(const char* file, bool header, bool direct) +{ + if (direct) printer().merge_export_file(file, header); + else + { + set_row(_currow+1,""); + TTextfile txt(file); + for (long i = 0l; i < txt.lines(); i++) + set_row(_currow+(int)i+1 + (i == 0l ? 1 : 0), txt.line_formatted(i)); + } +} + + void TPrint_application::set_row (int r, const char *frmt,...) { CHECK (r >= 1, "Print rows start at 1"); diff --git a/include/printapp.h b/include/printapp.h index 815d67a73..9be6a32c0 100755 --- a/include/printapp.h +++ b/include/printapp.h @@ -461,9 +461,10 @@ public: { printer().set_export_file(name,header); } // infila un file di export fatto da un'altra printer (con formati e tutto, ignora // gli header supponendo che siano gia' presenti nel file) - // se header == TRUE gli header stanno nel file e non vengono stampati - void merge_export_file(const char* file, bool header = TRUE) - { printer().merge_export_file(file,header); } + // se header == TRUE gli header stanno nel file e non vengono stampati + // se direct == FALSE le rigne vengono aggiunte con set_row da printapp, altrimenti + // si usa printer::merge_export_file + void merge_export_file(const char* file, bool header = TRUE, bool direct = FALSE); void set_n_copies(int n) { _ncopies = n; } diff --git a/include/printer.cpp b/include/printer.cpp index afe509de4..71131d00c 100755 --- a/include/printer.cpp +++ b/include/printer.cpp @@ -1330,13 +1330,11 @@ void TPrinter::set() _printertype = winprinter; break; case 1: // file - _printertype = fileprinter; _printerfile = mask.get (MSK_1_FILENAME); _curcode = atoi (mask.get (MSK_1_CODES)); break; case 2: // video - _printertype = screenvis; _curcode = 0; break; @@ -1355,15 +1353,15 @@ void TPrinter::set() void TPrinter::merge_export_file(const char* file, bool header) { - TTextfile txt(file); + TTextfile txt(file); for (long i = 0; i < txt.lines(); i++) { - TPrintrow* p = new TPrintrow(); + TPrintrow* p = new TPrintrow(); p->put(txt.line_formatted(i)); if (header) printrow(p); else print(*p); - } + } } void TPrinter::close ()