diff --git a/include/recset.cpp b/include/recset.cpp index 0ffeb9c99..6a8ab3fd2 100755 --- a/include/recset.cpp +++ b/include/recset.cpp @@ -641,7 +641,7 @@ static bool get_xml_child(const TString& line, const char* tag, TString& value) return false; } -bool list_custom_files(const char* ext, const char* library, TString_array& files) +bool list_custom_files(const char* ext, const char* classe, TString_array& files) { TString_array lista; TFilename path; @@ -664,7 +664,7 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file list_files(path, lista); sort_files(lista); // Ordino i files e rimuovo i doppioni - TToken_string libraries(50, ','); + TString8 acqua; TString stringona, desc; FOR_EACH_ARRAY_ROW(lista, i, row) @@ -678,17 +678,17 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file for (int i = 0; i < 3 && scan.good(); i++) // Leggo solo le prime righe stringona << scan.line(); - get_xml_attr(stringona, "libraries", libraries); - if (library && *library) - ok = libraries.get_pos(library) >= 0; + get_xml_attr(stringona, "class", acqua); + if (classe && *classe) + ok = acqua == classe; if (ok) { get_xml_child(stringona, "description", desc); TToken_string* riga = new TToken_string; riga->add(*row); + riga->add(acqua); riga->add(desc); - riga->add(libraries); files.add(riga); } } @@ -699,7 +699,7 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file bool select_custom_file(TFilename& path, const char* ext, const char* library) { - TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@20|Descrizione@50|Librerie@20")); + TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@8|Classe@8|Descrizione@50")); TString_array& files = sheet.rows_array(); bool ok = list_custom_files(ext, library, files); diff --git a/include/report.cpp b/include/report.cpp index d47d1629a..35ca058dc 100755 --- a/include/report.cpp +++ b/include/report.cpp @@ -1,11 +1,11 @@ #include #include -#include #include #include #include #include #include + #include #include #include @@ -2078,6 +2078,9 @@ bool TReport::load(const char* fname) if (desc != NULL) desc->GetEnclosedText(_description); + _class = xml.GetAttr("class"); + _command_line = xml.GetAttr("command"); + // Carico la query principale PRIMA delle sezioni che potrebbero collegarvicisi const TXmlItem* sql = xml.FindFirstChild("sql"); if (sql != NULL) @@ -2126,6 +2129,8 @@ bool TReport::save(const char* fname) const TXmlItem xml; xml.SetTag("report"); xml.SetAttr("name", name); + xml.SetAttr("class", _class); + xml.SetAttr("command", _command_line); xml.SetAttr("lpi", _lpi); if (!_description.blank()) xml.AddChild("description") << _description; diff --git a/include/report.h b/include/report.h index 749acba2c..baee13181 100755 --- a/include/report.h +++ b/include/report.h @@ -440,7 +440,9 @@ class TReport : public TAlex_virtual_machine TString _description; TReport_font _font, _print_font; // Font int _lpi; // Lines per inch - TToken_string _include; + TToken_string _include; // ex: calib + TString8 _class; // ex: ca3300a + TString _command_line; // ex: ca3 -2 TReport_script _prescript, _postscript; TString_array _params; TRecordset* _recordset; @@ -492,6 +494,10 @@ public: bool use_printer_font() const { return _use_printer_font; } void set_orientation(int orion) { _orientation = orion; } int orientation() const { return _orientation; } + const TString& get_class() const { return _class; } + void set_class(const char* classe) { _class = classe; } + const TString& command_line() const { return _command_line; } + void set_command_line(const char* cmd) { _command_line = cmd; } void set_font(const TReport_font& f) { _font = f; } void unmap_font(); diff --git a/include/reprint.cpp b/include/reprint.cpp index 128ff6448..d7890799c 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -243,7 +243,7 @@ public: PNT TPrint_preview_window::log2dev(long lx, long ly) const { - PNT pnt = { lx, ly }; + PNT pnt = { short(lx), short(ly) }; const TPoint res = _book->page_res(); if (res.x > 0 && res.y > 0) // Should always be true :-)