diff --git a/include/campo.aut b/include/campo.aut
index 50b3fc658..ea4a8f788 100755
--- a/include/campo.aut
+++ b/include/campo.aut
@@ -8,7 +8,7 @@ se Contabilita' Semplificata
cg Contabilita' Generale
st Gestione studi
mi Modello IVA 11
-ai Archiviazione Immagini
+rs Report di stampa
ce Cespiti
ad Anagrafici Dichiarazioni
sc Saldaconto
diff --git a/include/modaut.h b/include/modaut.h
index aeed130a2..cc0bf6269 100755
--- a/include/modaut.h
+++ b/include/modaut.h
@@ -13,7 +13,7 @@
#define MIAUT 9
#define AIAUT 10
#define CEAUT 11
-#define ADAUT 12
+#define RSAUT 12
#define SCAUT 13
#define SRAUT 14
#define CMAUT 15
diff --git a/include/netsock.cpp b/include/netsock.cpp
index 3f8ee0c40..82d397c46 100755
--- a/include/netsock.cpp
+++ b/include/netsock.cpp
@@ -844,7 +844,7 @@ bool TSocketClient::HttpSoap(CONNID id, const char* cmd)
if (cmd == NULL || *cmd == '\0')
return ok;
- char hostname[64];
+ char hostname[256];
xvt_sys_get_host_name(hostname, sizeof(hostname));
TString content(256);
diff --git a/include/printer.cpp b/include/printer.cpp
index 4e98482fc..e1caa4247 100755
--- a/include/printer.cpp
+++ b/include/printer.cpp
@@ -1251,7 +1251,7 @@ void TPrinter::read_configuration(
const TString& host = iniptr->get("Host");
if (host.not_empty())
{
- char hostname[32];
+ char hostname[256];
xvt_sys_get_host_name(hostname, sizeof(hostname));
read_rcd = (host == hostname); // Safe to read
if (!read_rcd)
@@ -1340,7 +1340,7 @@ void TPrinter::save_configuration()
prini.set("Lines", _lines_per_inch); // Linee per pollice
prini.set("Graphic", _isgraphics ? "X" : ""); // Grafica attiva
- char hostname[80];
+ char hostname[256];
xvt_sys_get_host_name(hostname, sizeof(hostname));
prini.set("Host", hostname);
prini.set("User", user());
diff --git a/include/report.cpp b/include/report.cpp
index 60702c471..0fef99a50 100755
--- a/include/report.cpp
+++ b/include/report.cpp
@@ -376,16 +376,17 @@ void advanced_draw_paragraph(TWindow& win, TString& para, const RCT& rct,
const bool acapo = para.find('\n') >= 0;
const bool parag = para.find(char(0xB6)) >= 0;
- if (acapo || parag) // Devo scrivere piu' righe?
- {
- int leading, ascent, descent;
- xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
- const int kx = xvt_dwin_get_text_width(win.win(), "ABCDEFGH", 8) / 8;
- const int ky = leading + ascent + descent;
+ int leading, ascent, descent;
+ xvt_dwin_get_font_metrics(win.win(), &leading, &ascent, &descent);
+ const int ky = leading + ascent + descent;
- const int rct_height = rct.bottom - rct.top;
+ const int rct_height = rct.bottom - rct.top;
+ int rows = rct_height / ky;
+
+ if (acapo || parag || rows > 1) // Devo scrivere piu' righe?
+ {
+ const int kx = xvt_dwin_get_text_width(win.win(), "ABCDEFGH", 8) / 8;
const unsigned columns = (rct.right - rct.left) / kx;
- int rows = rct_height / ky;
if (parag)
para.replace(char('0xB6'), '\n');
@@ -1939,8 +1940,8 @@ bool TReport::execute_prescript()
else
{
// Script dei poveri: lancia la maschera associata al report
- TFilename msk = _path; msk.ext("msk");
- if (msk.exist())
+ TFilename msk = _path.name(); msk.ext("msk");
+ if (msk.custom_path())
{
const KEY key = run_form(msk.name());
ok = key != K_ESC && key != K_QUIT;
@@ -2005,7 +2006,7 @@ bool TReport::get_record_field(const TString& name, TVariant& var) const
}
var = _recordset->get(str);
if (!var.is_null())
- return true;
+ found = true;
}
return found;
@@ -2400,12 +2401,31 @@ bool TReport::on_link(const TReport_link& lnk)
const int logicnum = table2logic(table);
if (logicnum >= LF_USER)
{
- TRectype rec(logicnum);
+ TRectype rec(logicnum);;
+ if (logicnum == LF_TAB || logicnum == LF_TABCOM)
+ rec.settab(table.right(3));
+
TAssoc_array& fields = lnk.fields();
+ TAssoc_array delayed;
FOR_EACH_ASSOC_OBJECT(fields, h, k, o)
{
- const TString* var = (const TString*)o;
- rec.put(k, *var);
+ const TFieldref fld(k, logicnum);
+ if (fld.from() > 0)
+ delayed.add(k, *o);
+ else
+ {
+ const TString* var = (const TString*)o;
+ fld.write(*var, rec);
+ }
+ }
+ if (delayed.items() > 0)
+ {
+ FOR_EACH_ASSOC_OBJECT(delayed, h, k, o)
+ {
+ const TFieldref fld(k, logicnum);
+ const TString* var = (const TString*)o;
+ fld.write(*var, rec);
+ }
}
return rec.edit();
}
diff --git a/include/reprint.cpp b/include/reprint.cpp
index 5dc98a7da..df44c361f 100755
--- a/include/reprint.cpp
+++ b/include/reprint.cpp
@@ -152,7 +152,7 @@ void TPrint_preview_window::update()
{
const TPoint res = _book->page_res();
const int lpi = _book->lpi();
- for (int i = 1; ; i++)
+ for (int i = 1; lpi > 0; i++)
{
set_pen(i%lpi ? MAKE_COLOR(232,232,255) : MAKE_COLOR(255,192,255));
const short y = i * res.y / lpi;
@@ -161,7 +161,7 @@ void TPrint_preview_window::update()
line(0, y, (short)size.x, y);
}
const int cpi = _book->cpi();
- for (int j = 1; ; j++)
+ for (int j = 1; cpi > 0; j++)
{
set_pen(j%10 ? MAKE_COLOR(232,232,255) : MAKE_COLOR(255,192,255));
const short x = j * res.x / cpi;
@@ -865,7 +865,7 @@ bool TBook::print_page(TWindow& win, size_t page)
if (img != NULL)
img->draw(win.win(), rct);
}
- if (str.starts_with(""))
+ if (str == "")
{
PNT fr = { rct.top, rct.left };
PNT to = { rct.bottom, rct.right };
@@ -904,7 +904,7 @@ bool TBook::print_page(TWindow& win, size_t page)
break;
stringona << str;
}
- advanced_draw_text(win, stringona, rct, _horizontal_alignment, _vertical_alignment);
+ advanced_draw_paragraph(win, stringona, rct, _horizontal_alignment, _vertical_alignment);
continue;
}
if (str.starts_with("")
+ {
+ if (hei == 0 && wid > 0)
+ {
+ if (page.objptr(row) == NULL)
+ page.add("", row);
+ TString& line = page.row(row++);
+ const TString stringona(wid, '-');
+ line.overwrite(stringona, col);
+ }
+ }
if (str.starts_with("filename();
- TProgind pi(rex->items(), msg, true, true);
+
+ TProgind* pi = NULL;
+ if (progind)
+ pi = new TProgind(rex->items(), msg, true, true);
TString_array oldgroup, newgroup;
const int max_group = _report->find_max_level('H');
@@ -1413,9 +1428,12 @@ bool TReport_book::add(TReport& rep)
}
}
- pi.addstatus(1);
- if (pi.iscancelled())
- _print_aborted = true;
+ if (pi != NULL)
+ {
+ pi->addstatus(1);
+ if (pi->iscancelled())
+ _print_aborted = true;
+ }
}
if (!_print_aborted)
@@ -1454,7 +1472,10 @@ bool TReport_book::add(TReport& rep)
_report->execute_postscript();
}
- return true;
+ if (pi != NULL)
+ delete pi;
+
+ return !_print_aborted;
}
int TReport_book::lpi() const
@@ -1512,6 +1533,11 @@ bool TReport_book::on_link(const TReport_link& lnk)
return ok;
}
+TReport_book::TReport_book(const char* name)
+ : TBook(name), _report(NULL)
+{
+}
+
///////////////////////////////////////////////////////////
// Remote control interface
///////////////////////////////////////////////////////////
diff --git a/include/reprint.h b/include/reprint.h
index 0fdad454d..3d99d4793 100755
--- a/include/reprint.h
+++ b/include/reprint.h
@@ -89,13 +89,13 @@ protected:
long print_section(char type, int level);
public:
- bool add(TReport& report);
+ bool add(TReport& report, bool progind = true);
virtual int lpi() const;
virtual int cpi() const;
virtual bool print(size_t pagefrom = 0, size_t pageto = 0, size_t copies = 0);
- TReport_book(const char* name = NULL) : TBook(name) { }
+ TReport_book(const char* name = NULL);
};
void abort_printing();