From 180a0b720cf66c6ed7e6f191c9ed62d6f6d2253b Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 18 Sep 2007 10:38:15 +0000 Subject: [PATCH] Patch level :4.0 981 Files correlati : Ricompilazione Demo : [ ] Commento :corretti casini di riporto git-svn-id: svn://10.65.10.50/trunk@15626 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/recset.cpp | 27 ++----- include/reprint.cpp | 175 +------------------------------------------ include/sheet.cpp | 4 +- include/sheet.h | 2 +- include/validate.cpp | 1 - 5 files changed, 11 insertions(+), 198 deletions(-) diff --git a/include/recset.cpp b/include/recset.cpp index be213b23a..b4ff0dac1 100755 --- a/include/recset.cpp +++ b/include/recset.cpp @@ -685,16 +685,10 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files TString_array lista; TFilename path; - { TWait_cursor hourglass; TString_array files; - TFilename name = path.name(); - const bool wild = (name.find('*') >= 0) || (name.find('?') >= 0); - if (!wild) - name = "*"; - // Leggo i files in custom if (main_app().has_module(RSAUT)) { @@ -704,7 +698,7 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files xvt_fsys_mkdir(custom); path = custom; - path.add(name); + path.add("*"); path.ext(ext); } list_files(path, lista); @@ -732,17 +726,8 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files if (classe && *classe) ok = acqua == classe; - list_files(path, files); - } - path = name; path.ext(ext); // Leggo i files in campo - list_files(path, files); - sort_files(files); // Ordino i files e rimuovo i doppioni - - TString str; - FOR_EACH_ARRAY_ROW(files, i, row) - { - path = *row; path.ext(ext); - if (path.custom_path()) + + if (ok) { get_xml_child(stringona, "description", desc); TToken_string* riga = new TToken_string; @@ -750,18 +735,18 @@ bool list_custom_files(const char* ext, const char* classe, TString_array& files riga->add(acqua); riga->add(desc); files.add(riga); - } } } return !files.empty(); } -bool select_custom_file(TFilename& path, const char* ext, const char* library) +bool select_custom_file(TFilename& path, const char* ext, const char* classe) { TArray_sheet sheet(-1, -1, 78, 20, TR("Selezione"), HR("Nome@8|Classe|Descrizione@50|Custom")); TString_array& files = sheet.rows_array(); - bool ok = list_custom_files(ext, library, files); + + bool ok = list_custom_files(ext, classe, files); if (ok) { diff --git a/include/reprint.cpp b/include/reprint.cpp index 406f2817f..4fa3acc3e 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -995,7 +995,7 @@ void TBook::draw_text(const TRectangle& r, const char* txt) define_frame(r); *_out << "" << endl << str << endl << "" << endl; } -††} + } } void TBook::draw_text(const TRectangle& r, const TString_array& txt) @@ -1650,15 +1650,6 @@ bool TBook::init() return true; } -void TBook::close_output() -{ - if (_out != NULL) - { - _out->close(); - delete _out; - } - _out = NULL; -} void TBook::split_file(int colonne) { @@ -1720,105 +1711,6 @@ void TBook::split_file(int colonne) _pages = _index.last(); } -void TBook::join_file(int pps) -{ - TProgind pi(pages(), TR("Rigenerazione pagine"), true, true); - - TFilename temp; temp.temp(); - ofstream out(temp); - - - close_output(); // Chiudo file di stampa eventualmente aperto - ifstream ifs(_file); // Apro file di stampa da splittare - - _index.destroy(); // Distruggo il vecchio indice delle pagine che poi ricostruisco - _pages = (_pages - 1) / pps + 1; // Ricalcolo in nuovo numero di pagine totali - - int in_page = 1; - int out_page = 0; - int off_page = 0; - - TString str(1024); - char* buffer = str.get_buffer(); - while (!ifs.eof()) - { - ifs.getline(buffer, str.size()); - - if (str.starts_with("", out_page); - } - else - { - // E' utile resettare l'allineamento dei testi :-) - str = ""; - } - } else - if (str.starts_with(" 0) - { - long x, y, dx, dy; - SAFE_SCAN(str, "", &x, &y, &dx, &dy); - str.format("", x, y+off_page, dx, dy); - } else - if (str.starts_with("", out_page); - out_page = 0; - } - else - continue; - } - out << str << endl; - } - - if (out_page != 0) // Non ho ancora scritto l'ultimo fine pagina - { - str.format("", out_page); - out << str << endl; - } - - out.close(); - - // Sostituisce il file di stampa con quello joinato ed aggiorna l'indice delle pagine - fcopy(temp, _file); - xvt_fsys_removefile(temp); -} - -bool TBook::split_file_if_needed() -{ - const TPoint sheet(logical_page_width(), logical_page_height()); - - const int colonne = _max_frame.x > sheet.x ? (_max_frame.x+sheet.x-1) / sheet.x : 1; - if (colonne > 1) - { - if (yesno_box(FR("Si desidera suddividere le pagine su %d fogli"), colonne)) - split_file(colonne); - } - else - { - const int pps = (_max_frame.y > 100 && pages() > 1) ? sheet.y / _max_frame.y : 1; - if (pps > 1) - { - if (yesno_box(FR("Si desidera raggruppare %d pagine per foglio"), pps)) - join_file(pps); - } - } - - _max_frame.x = _max_frame.y = 0; // Impedisce ulteriore splitting - - return true; -} - void TBook::close_output() { if (_out != NULL) @@ -1829,66 +1721,6 @@ void TBook::close_output() _out = NULL; } -void TBook::split_file(int colonne) -{ - TProgind pi(pages(), TR("Rigenerazione pagine"), true, true); - - TFilename temp; temp.temp(); - ofstream out(temp); - TPointer_array index; - - close_output(); // Chiudo file di stampa eventualmente aperto - ifstream ifs(_file); // Apro file di stampa da splittare - - TString str(1024); - char* buffer = str.get_buffer(); - for (unsigned int page = 1; page <= pages(); page++) - { - if (!pi.setstatus(page)) - break; - const streampos pos = _index.get_long(page); - for (int c = 0; c < colonne; c++) - { - const TRectangle rct_page(c*_pw, 0, _pw, _ph); - - ifs.seekg(pos); - while (!ifs.eof()) - { - ifs.getline(buffer, str.size()); - - if (str.starts_with("", p); - } else - if (str.starts_with("", &x, &y, &dx, &dy); - str.format("", x-rct_page.x, y, dx, dy); - } else - if (str.starts_with("", index.last()); - } - - out << str << endl; - if (str.starts_with(" 100 && _max_frame.y > 100) // Evita calcolo splitting se possibile { - // Dalla 3.1 in poi deve essere fatto cosi'! - const TPoint sheet(logical_page_width(), logical_page_height()); - // Nella 3.0 deve essere fatto cosa'! - // const TPoint sheet(_pw, _ph); + const TPoint sheet(_pw, _ph); const int spp = _max_frame.x > sheet.x ? (_max_frame.x+sheet.x-1) / sheet.x : 1; if (spp > 1 && can_split(spp)) // Sheets per page diff --git a/include/sheet.cpp b/include/sheet.cpp index 400002800..a0066fc27 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -1659,7 +1659,7 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields, const char* title, const char* head, byte buttons, TEdit_field& f, TToken_string& sibling) : TCursor_sheet(cursor, fields, title, head, buttons, - f->browse() ? f->browse()->input_fields() : 1), + f.browse() ? f.browse()->input_fields() : 1), _field(f), _sel(0), _original_filter(cursor->filter()) { const bool normal = f.browse() != NULL && sibling.full(); @@ -1732,7 +1732,7 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields, TString8 flags; - †††††††if (c.roman()) flags << 'M'; + if (c.roman()) flags << 'M'; if (c.right_justified()) flags << 'R'; if (c.uppercase()) flags << 'U'; if (c.zerofilled()) flags << 'Z'; diff --git a/include/sheet.h b/include/sheet.h index 9cfa5c30f..f5e5c6ad0 100755 --- a/include/sheet.h +++ b/include/sheet.h @@ -225,7 +225,7 @@ class TBrowse_sheet : public TCursor_sheet // @access:(INTERNAL) Private Member { // @cmember:(INTERNAL) Campi collegati ai campi editabili (vedi ) - TEdit_field* const _field; + TEdit_field& _field; // @cmember:(INTERNAL) filtro originale del cursore TString _original_filter; diff --git a/include/validate.cpp b/include/validate.cpp index 36342e9d7..64a4a742d 100755 --- a/include/validate.cpp +++ b/include/validate.cpp @@ -803,7 +803,6 @@ HIDDEN bool _ora_val(TMask_field& f, KEY key) else return f.error_box(TR("Ora errata o formato non valido")); } - } } return true; }