Patch level : 12.0 400

Files correlati     : ba8.exe

Aggiunto un campo lughezza fissa per l'esportazione dei file di testo. Se non valorizzato il file non è a lughezza fissa.
Questa funzione sarà presente nei programmi dalla patch 402.

git-svn-id: svn://10.65.10.50/branches/R_10_00@23848 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2017-05-29 16:07:51 +00:00
parent 224e4f09a4
commit 1b909f2ae1
2 changed files with 13 additions and 4 deletions

View File

@ -1577,7 +1577,7 @@ bool TBook::print_page(TWindow& win, size_t page)
return true;
}
bool TBook::export_text(TFilename& fname, bool signature)
bool TBook::export_text(TFilename& fname, bool signature, int size)
{
TString ext = fname.ext(); ext.lower();
if (ext == "pdf")
@ -1667,8 +1667,17 @@ bool TBook::export_text(TFilename& fname, bool signature)
for (int i = 0; i <= last_row; i++)
{
const TString* line = (const TString*)page.objptr(i);
int linelen = 0;
if (line != NULL)
{
linelen = line->len();
ofs << *line;
}
if (size > 0)
while (linelen++ < size)
ofs << ' ';
ofs << endl;
}
} else
@ -2249,7 +2258,7 @@ bool TBook::esporta()
break;
case 'E':
case 'e':
ok = export_text(fname, signature);
ok = export_text(fname, signature, size);
if (ok)
xvt_sys_goto_url(fname, "open");
break;
@ -2328,7 +2337,7 @@ bool TBook::print_or_preview()
case exportprinter:
{
TFilename f = printer().get_export_file();
ok = export_text(f, false);
ok = export_text(f, false, 0);
if (ok)
xvt_sys_goto_url(f, "open");
}

View File

@ -99,7 +99,7 @@ public:
virtual bool export_excel(TFilename& fname, bool signature);
virtual bool export_pdf(TFilename& fname, bool signature);
virtual bool export_text(TFilename& fname, bool signature);
virtual bool export_text(TFilename& fname, bool signature, int size);
virtual bool send_mail(TFilename& fname, bool signature);
virtual bool esporta();
bool print_or_preview(); // Calls one of the above