From 2d9e19f5378cbd905ef4c872565d30cb0b5b2b03 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 13 Dec 2013 09:33:44 +0000 Subject: [PATCH] Correzioni a tutto campo git-svn-id: svn://10.65.10.50/branches/R_10_00@22905 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/alex.cpp | 3 +- include/alleg.h | 16 ++++++--- include/applicat.cpp | 2 +- include/brwbut.cpp | 20 +++++++++-- include/brwbut.h | 3 ++ include/campo.aut | 4 +-- include/checks.cpp | 2 +- include/config.cpp | 59 +++++++++++++++++++++++---------- include/config.h | 11 +++--- include/controls.cpp | 18 ++++++++++ include/controls.h | 5 ++- include/doc.h | 9 ++--- include/dongle.cpp | 3 +- include/execp.cpp | 14 ++++---- include/golem.cpp | 2 +- include/isam.cpp | 2 +- include/mask.cpp | 4 +-- include/maskfld.cpp | 2 +- include/modaut.h | 4 +-- include/mov.h | 7 ++-- include/msksheet.cpp | 39 ++++++++++++---------- include/multirec.cpp | 10 +++--- include/multirec.h | 2 +- include/pconti.h | 1 - include/postman.cpp | 24 +++++++------- include/relapp.cpp | 2 ++ include/reprint.cpp | 79 +++++++++++++++++++++++++++----------------- include/tabapp.cpp | 2 +- include/tabutil.cpp | 8 ++--- include/textset.cpp | 9 ++--- include/xvtility.cpp | 11 +++--- 31 files changed, 235 insertions(+), 142 deletions(-) diff --git a/include/alex.cpp b/include/alex.cpp index 665751803..e8e8e487b 100755 --- a/include/alex.cpp +++ b/include/alex.cpp @@ -890,7 +890,8 @@ void TAVM::execute(const TAVM_op& op) { const TVariant& v0 = _stack.pop(); const TVariant& v1 = _stack.pop(); - _stack.push(v0.as_real() * v1.as_real()); + const real r = v0.as_real() * v1.as_real(); + _stack.push(r); } break; case avm_negate: diff --git a/include/alleg.h b/include/alleg.h index ffb52347d..9e4c5792b 100755 --- a/include/alleg.h +++ b/include/alleg.h @@ -19,14 +19,22 @@ DEFFLD(IGNORA) // Content fields DEFFLD(DATAREG) DEFFLD(NUMDOC) -DEFFLD(MODPAG) +DEFFLD(DATADOC) +DEFFLD(TIPOIVA) DEFFLD(IMPORTO) DEFFLD(IMPOSTA) DEFFLD(TIPOPE) -DEFFLD(CONTRATTO) -DEFFLD(DATARETT) -DEFFLD(NUMRETT) +DEFFLD(NOLEGGIO) +DEFFLD(AUTOFATT) +DEFFLD(REVERSE) +DEFFLD(SERVIZI) +DEFFLD(TURISMO) +DEFFLD(RIEPILOG) +DEFFLD(CARBURAN) + +DEFFLD(ATTAGG) +DEFFLD(PASAGG) #undef DEFFLD diff --git a/include/applicat.cpp b/include/applicat.cpp index 74a98e2de..39aaf5c34 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -438,7 +438,7 @@ bool TApplication::test_assistance_year() const if (ok) { ok = app_year <= dongle_year; - if (ok) + if (ok && check_autorization()) { Tdninst dninst; //queste 2 righe sono quelle da mettere nei programmi ok = dninst.can_I_run(); diff --git a/include/brwbut.cpp b/include/brwbut.cpp index bf51c51bb..6c838e075 100644 --- a/include/brwbut.cpp +++ b/include/brwbut.cpp @@ -352,7 +352,7 @@ void TBrowse::parse_output(TScanner& scanner) bool TBrowse::parse_copy(const TString& what, const TBrowse& b) { - const bool all = what == "AL"; + const bool all = what.starts_with("AL"); if (all || what == "US") { set_insert(b.get_insert()); @@ -382,6 +382,17 @@ bool TBrowse::parse_copy(const TString& what, const TBrowse& b) return true; } +void TBrowse::replace_cursor(TCursor* c) +{ + if (_relation != NULL) + { + CHECK(c->file().num() == _cursor->file().num(), "Replacing incompatible cursor"); + delete _relation; + _relation = NULL; // Not owned cursor! + delete _cursor; + } + _cursor = c; +} void TBrowse::parse_join(TScanner& scanner) { @@ -746,8 +757,11 @@ int TBrowse::do_input( } _cursor->relation()->mask2rel(field().mask()); - _cursor->setfilter(work, filter_update); - _cursor->setregion(filtrec, filtrec); + if (!_cursor->frozen()) + { + _cursor->setfilter(work, filter_update); + _cursor->setregion(filtrec, filtrec); + } return ne; } diff --git a/include/brwbut.h b/include/brwbut.h index 986b9638a..de4cfeb65 100644 --- a/include/brwbut.h +++ b/include/brwbut.h @@ -213,6 +213,9 @@ public: // @cmember Aggiorna la lista completa degli identificatori dei campi di output da un campo void copy_output(const TBrowse * b); + // @cmember Cambia il cursore senza darne il possesso (come nella COPY USE) + void replace_cursor(TCursor* c); + // @cmember Aggiunge un campo di output alla posizione void add_output_field(const char * id, const char * name, const int pos = -1); diff --git a/include/campo.aut b/include/campo.aut index 5a98cfcd9..e2e220b01 100755 --- a/include/campo.aut +++ b/include/campo.aut @@ -1,7 +1,7 @@ ba Base ct CUP Tracciabilità np No Profit -fe Spesometro +fe Comunicazione Polivalente 77 Percipienti ?? Modulo vario ex- Gestione IVA se Contabilità Semplificata @@ -27,7 +27,7 @@ pe Preventivazione ep Effetti Passivi tc Trasferimento altre Contabilità fd Firma digitale -?? Modulo vario ex-co Gestione cooperative +f3 Comunicazione Polivalente 2013 av AVIS Assist ve Vendite mg Magazzino diff --git a/include/checks.cpp b/include/checks.cpp index 47af2e77d..8babd37c0 100755 --- a/include/checks.cpp +++ b/include/checks.cpp @@ -139,7 +139,7 @@ bool yesnofatal_box( // // @xref { - buildmsg(); + buildmsg(); #ifdef DBG char user[32]; xvt_sys_get_user_name(user, sizeof(user)); diff --git a/include/config.cpp b/include/config.cpp index 2383828ba..765ac8150 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -49,19 +49,22 @@ bool TConfig::_read_paragraph() // @comm Legge il contenuto di tutte le variabili del paragrafo attivo { - bool itwas = FALSE; + bool itwas = false; _data.destroy(); - TScanner scan(_file); - if (scan.paragraph(_paragraph)) + if (_file.exist()) { - itwas = TRUE; - // populate array - while(TRUE) + TScanner scan(_file); + itwas = scan.paragraph(_paragraph); + if (itwas) { - const TString& l = scan.line(); - if (l.empty() || l[0] == '[') break; // Fine paragrafo - if (l[0] == '#' || l[0] == '/') continue; // Riga di commento - add_line(l); + // populate array + for(;;) + { + const TString& l = scan.line(); + if (l.empty() || l[0] == '[') break; // Fine paragrafo + if (l[0] == '#' || l[0] == '/') continue; // Riga di commento + add_line(l); + } } } return itwas; @@ -180,6 +183,15 @@ bool TConfig::set_paragraph(const char* section) return ok; } +bool TConfig::set_paragraph(int par, int sub) +{ + CHECKD(par > 0 && sub >= 0, "Invalid numeric paragraph ", par); + TString16 pa; pa << par; + if (sub > 0) pa << ',' << sub; + return set_paragraph(pa); +} + + const char* TConfig::get_varkey(const char* var, int index) const { if (index >= 0) @@ -631,15 +643,18 @@ void TConfig::init( int TConfig::list_paragraphs(TString_array& pl) { - TScanner s(_file); pl.destroy(); - while (s.line().not_empty()) + if (_file.exist()) { - if (s.token()[0] == '[') + TScanner s(_file); + while (s.line().not_empty()) { - TToken_string* p = new TToken_string(s.token()); - p->strip("[]"); - pl.add(p); + if (s.token()[0] == '[') + { + TToken_string* p = new TToken_string(s.token()); + p->strip("[]"); + pl.add(p); + } } } return pl.items(); @@ -844,8 +859,16 @@ TConfig::TConfig(int which_config, const char* paragraph) TConfig::TConfig(const char *fn, const char* pa) { - TFilename f(fn); - f.custom_path(); + TFilename f(fn); f.custom_path(); + init(f, pa); +} + +TConfig::TConfig(const char* file, int num, int sub) +{ + CHECKD(num > 0 && num < 10000, "Invalid paragraph ", num); + TFilename f(file); f.custom_path(); + TString16 pa; pa << num; + if (sub > 0) pa << ',' << sub; init(f, pa); } diff --git a/include/config.h b/include/config.h index fcb5339d2..e88cf2398 100755 --- a/include/config.h +++ b/include/config.h @@ -144,6 +144,7 @@ public: const TString& get_paragraph() const { return _paragraph; } // @cmember Setta il paragrafo passato come quello attivo bool set_paragraph(const char* par); + bool set_paragraph(int par, int sub = 0); // @cmember Riempie pl con la lista dei paragrafi int list_paragraphs(TString_array& pl); @@ -165,17 +166,17 @@ public: const TFilename& name() const { return _file; } // @cmember Setta il valore del flag di protezione da scrittura - void write_protect(const bool b = TRUE) { _write_protected = b; } + void write_protect(const bool b = true) { _write_protected = b; } // @cmember Ritorna il valore del flag di protezione da scrittura const bool is_write_protected() const { return _write_protected; } - // @cmember Costruttore (il paragrafo iniziale e' il modulo corrente - // salvo diversa indicazione) + // @cmember Costruttore (il paragrafo iniziale è il modulo corrente salvo diversa indicazione) TConfig(int which_config, const char* paragraph = NULL); - // @cmember Costruttore (il paragrafo iniziale e' il modulo corrente - // salvo diversa indicazione) + // @cmember Costruttore (il paragrafo iniziale è il modulo corrente salvo diversa indicazione) TConfig(const char* file, const char* paragraph = NULL); + // @cmember Costruttore (il paragrafo iniziale è solitamente il numero di un file) + TConfig(const char* file, int num, int sub = 0); // @ cmember Distruttore. Riscrive il file con le modifiche se necessrio, virtual ~TConfig(); diff --git a/include/controls.cpp b/include/controls.cpp index c91545cdc..3b389e0d5 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -78,7 +78,25 @@ void low_set_focus_id(WINDOW win, short id) xi_set_focus(itf); } +bool is_full_screen_interface(WINDOW win) +{ + XI_OBJ * itf = xi_get_itf((XinWindow)win); + return itf != NULL && (itf->app_data2 & 0x1) != 0; +} +bool set_full_screen_interface(WINDOW win, bool on) +{ + XI_OBJ * itf = xi_get_itf((XinWindow)win); + if (itf != NULL) + { + if (on) + itf->app_data2 |= 0x1; + else + itf->app_data2 &= ~0x1; + return true; + } + return false; +} KEY TControl::xiev_to_key(const XI_EVENT* xiev) { diff --git a/include/controls.h b/include/controls.h index c4706c249..eec0b1f54 100755 --- a/include/controls.h +++ b/include/controls.h @@ -33,6 +33,9 @@ void low_set_focus_id(WINDOW win, short cid); bool has_virtual_keyboard(); XVT_IMAGE get_background_texture(); +bool is_full_screen_interface(WINDOW win); +bool set_full_screen_interface(WINDOW win, bool on); + /////////////////////////////////////////////////////////// // Custom control /////////////////////////////////////////////////////////// @@ -339,4 +342,4 @@ public: int xvtil_drop_down_list(XI_OBJ* field_or_cell, const char* codes, const char* values); const char* xvtil_get_cell_selection(XI_OBJ* field_or_cell, int sel, const char* cod, const char* val); -#endif \ No newline at end of file +#endif diff --git a/include/doc.h b/include/doc.h index bd5adc36b..cf4499533 100755 --- a/include/doc.h +++ b/include/doc.h @@ -35,8 +35,8 @@ #define DOC_CODINDSP "CODINDSP" #define DOC_DATADOCRIF "DATADOCRIF" #define DOC_NUMDOCRIF "NUMDOCRIF" -#define DOC_CODNUMRIF "CODNUMRIF" -#define DOC_ANNORIF "ANNORIF" +#define DOC_CODNUMRIF "CODNUMRIF" +#define DOC_ANNORIF "ANNORIF" #define DOC_ZONA "ZONA" #define DOC_CODAG "CODAG" #define DOC_CODAGVIS "CODAGVIS" @@ -92,11 +92,8 @@ #define DOC_DATASCIMP "DATASCIMP" #define DOC_CUP "CUP" #define DOC_CIG "CIG" -#define DOC_CONTRATTO "CONTRATTO" -#define DOC_MODPAG "MODPAG" #define DOC_CONTSEP "CONTSEP" -#define DOC_CONTRATTO "CONTRATTO" -#define DOC_MODPAG "MODPAG" +#define DOC_NOLEGGIO "NOLEGGIO" // Virtuali diff --git a/include/dongle.cpp b/include/dongle.cpp index 461c09736..27380a4c6 100755 --- a/include/dongle.cpp +++ b/include/dongle.cpp @@ -1279,13 +1279,12 @@ bool Tdninst::can_I_run(const bool is_personal_program) const if (cmdline.starts_with("ba", true) || cmdline.ends_with("cnv", true)) return true; - const bool me = is_personal_program || (cmdline.len()>3 && !cmdline.ends_with("mod", true)); const char* option = main_app().argc() > 1 ? main_app().argv(1) : ""; if (*option == '-' && isdigit(*(option+1))) cmdline << ' ' << option; cmdline.lower(); TString msg; - return test_cmdline(cmdline, me, msg) == 0; + return test_cmdline(cmdline, is_personal_program, msg) == 0; } bool Tdninst::find_serno() const diff --git a/include/execp.cpp b/include/execp.cpp index 993cd5262..e8d5601c1 100755 --- a/include/execp.cpp +++ b/include/execp.cpp @@ -85,11 +85,13 @@ long TExternal_app::run( TString256 old_title; // Vecchio titolo della finestra principale bool close_all = false; // Chiudi tutti i file in caso di manutenzione - + bool login_needed = false; if (!async && utente) { - if (dongle().local()) // Rilascio la chiave il prima possibile - dongle().logout(); + // Rilascio la chiave hardware (Eutron o Hardlock) il prima possibile + // Network e SSA non hanno bisogno di questo accorgimento + if (dongle().hardware() < _dongle_network) + login_needed = dongle().logout(); close_all = _path.starts_with("ba1 -0") && prefix_valid(); if (close_all) //se lancia la gestione archivi forza la chiusura dei files e pure dei tracciati! @@ -125,10 +127,10 @@ long TExternal_app::run( // ignorato. if (!async && utente) { - if (dongle().local()) - dongle().login(); + if (login_needed) + dongle().login(); - if (close_all) //se lancia la gestione archivi forza la riapertura dei files e pure dei tracciati! + if (close_all) //se lancia la gestione archivi forza la riapertura dei files e pure dei tracciati! prefix().set("DEF"); //..li aveva chiusi qualche riga sopra } diff --git a/include/golem.cpp b/include/golem.cpp index 1b0857139..895a9f6fc 100755 --- a/include/golem.cpp +++ b/include/golem.cpp @@ -885,7 +885,7 @@ bool TMAPI_session::remove(const TString& id) if (err == SUCCESS_SUCCESS) ok = true; else - error_box("Can't delete mail message: %ld", err); + error_box("Can't delete mail message %s\nError %ld", (const char*)id, err); } return ok; } diff --git a/include/isam.cpp b/include/isam.cpp index cd7567a4b..d70caac68 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -1229,7 +1229,7 @@ int TBaseisamfile::_open( TString msg; msg.format("Lunghezza record incoerente sul file %d (%s): file=%d trc=%d", num(), (const char*)filename, dbfreclen, trcreclen); - if (n == 0) + if (n <= 0) { msg << "\nSi consiglia di eliminare il file ed i suoi indici."; error_box(msg); diff --git a/include/mask.cpp b/include/mask.cpp index f12d96869..c568a84fa 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -1278,7 +1278,7 @@ void TMask::read_page( scanner.push_win(w); - while (scanner.popkey() != "EN") + while (scanner.popkey() != "EN" && scanner.key().full()) { TMask_field* f = NULL; if (is_toolbar && r.top == 0) @@ -1295,7 +1295,7 @@ void TMask::read_page( e << "\nL'ultimo riconosciuto è " << fld(pf-1).dlg() << ": " << fld(pf-1).prompt(); error_box(e); #endif - while (scanner.popkey() != "EN"); + while (scanner.popkey() != "EN" && scanner.key().full()); } else { diff --git a/include/maskfld.cpp b/include/maskfld.cpp index 33d30486a..08beb8918 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -2186,7 +2186,7 @@ bool TEdit_field::parse_item(TScanner& scanner) if (altkey <= 2 || altkey > maxkey) { - switch (r->file().num()) + switch (logicnum) { case LF_CLIFO: altkey = 6; break; default : altkey = 0; break; diff --git a/include/modaut.h b/include/modaut.h index 27f2ad756..7fdf88598 100755 --- a/include/modaut.h +++ b/include/modaut.h @@ -24,13 +24,13 @@ #define ABAUT 20 //#define GVAUT 21 #define CAAUT 22 -//#define VDAUT 23 +#define SLAUT 23 #define ICAUT 24 #define PEAUT 25 #define EPAUT 26 #define TCAUT 27 #define FDAUT 28 -//#define COAUT 29 +#define F3AUT 29 #define VEAUT 31 #define MGAUT 32 #define ORAUT 33 diff --git a/include/mov.h b/include/mov.h index d3a88d969..95d680298 100755 --- a/include/mov.h +++ b/include/mov.h @@ -48,11 +48,8 @@ #define MOV_DATAINC "DATAINC" #define MOV_LIQDIFF "LIQDIFF" #define MOV_IVAXCASSA "IVAXCASSA" -#define MOV_MODPAG "MODPAG" -#define MOV_CONTRATTO "CONTRATTO" -#define MOV_DATARETT "DATARETT" -#define MOV_NUMRETT "NUMRETT" -#define MOV_ANNOFE "ANNOFE" +#define MOV_NOLEGGIO "NOLEGGIO" +#define MOV_INVIOFE "INVIOFE" #define MOV_CONTSEP "CONTSEP" #define NUMREG_PROVVISORIO 999999L diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 2e0ab5fe0..a62e25f76 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -787,26 +787,29 @@ int TSpreadsheet::find_enabled_column(int rec, int colonna, int direction) const if (prop != NULL && prop->height() == 0) return 0; - int num; + int num = 0; XI_OBJ** column = xi_get_member_list(_obj, &num); - if (colonna <= 0 || colonna >= num) - colonna = 1; - - int c = colonna; - do - { - const short n = column[c]->cid - FIRST_FIELD; - if (!cell_disabled(rec, n)) - return c; + + if (num > 1) + { + if (colonna <= 0 || colonna >= num) + colonna = 1; + int c = colonna; + do + { + const short n = column[c]->cid - FIRST_FIELD; + if (!cell_disabled(rec, n)) + return c; - c += direction; - if (c >= num) - c = 1; - else - if (c <= 0) - c = num-1; - } - while (c != colonna); + c += direction; + if (c >= num) + c = 1; + else + if (c <= 0) + c = num-1; + } + while (c != colonna); + } return 0; } diff --git a/include/multirec.cpp b/include/multirec.cpp index fdf8616b3..b77a0824d 100755 --- a/include/multirec.cpp +++ b/include/multirec.cpp @@ -84,6 +84,7 @@ void TMultiple_rectype::load_rows_file(int logicnum) if (r == NULL) { // crea + if (logicnum <= 0) logicnum = lognum(index); r = new TRecord_array(logicnum, _numfields.row(index)); _files.add(r, index); } @@ -95,7 +96,7 @@ void TMultiple_rectype::load_rows_file(int logicnum) int TMultiple_rectype::find(int logicnum, const char* fieldname, const char* s, int from, bool reverse) const { - const TRecord_array & recarray = body(logicnum); + const TRecord_array& recarray = body(logicnum); const int last = recarray.last_row(); const int len = s ? strlen(s) : 0; @@ -205,10 +206,9 @@ int TMultiple_rectype::log2ind(int logicnum) const TRecord_array& TMultiple_rectype::body(int logicnum) const { const int index = log2ind(logicnum); - if (_files.objptr(index) == NULL || _changed[index]) - ((TMultiple_rectype*) this)->load_rows_file(lognum(index)); - return (TRecord_array&) _files[index]; + ((TMultiple_rectype*)this)->load_rows_file(lognum(index)); // logicnum may be 0! + return (TRecord_array&)_files[index]; } void TMultiple_rectype::renum_key() @@ -217,7 +217,7 @@ void TMultiple_rectype::renum_key() for (int i = _files.last(); i >= 0 ; i = _files.pred(i)) { const int logicnum = lognum(i); - TRecord_array * b = & body(logicnum); + TRecord_array* b = &body(logicnum); if (b) { if (i==0) diff --git a/include/multirec.h b/include/multirec.h index 417005480..1e63b8392 100755 --- a/include/multirec.h +++ b/include/multirec.h @@ -43,7 +43,7 @@ protected: // @cmember renumera le chiavi di tutti i corpi in base alla testata virtual void renum_key(); // @cmember Genera il record del corpo - virtual TRectype * new_body_record(int logicnum = 0) { return new TRectype(logicnum ? logicnum : lognum(0)); } + virtual TRectype * new_body_record(int logicnum = 0) { return new TRectype(logicnum > 0 ? logicnum : lognum(0)); } // @cmember Crea e carica il record array del corpo virtual void load_rows_file(int logicnum); // @cmember Ritorna l'indice di

del numero logico passato diff --git a/include/pconti.h b/include/pconti.h index 040985251..a31f4d7e5 100755 --- a/include/pconti.h +++ b/include/pconti.h @@ -31,7 +31,6 @@ #define PCN_CODCMS "CODCMS" #define PCN_FASCMS "FASCMS" #define PCN_ANALITICA "ANALITICA" -#define PCN_SERVIZI "SERVIZI" #endif diff --git a/include/postman.cpp b/include/postman.cpp index d55cfd320..be253a988 100755 --- a/include/postman.cpp +++ b/include/postman.cpp @@ -96,7 +96,7 @@ bool TRecipient::can_receive(const TRectype& rec) const class TPostman : public TObject { long _firm; - bool _recipients_ok; + int _recipients_lognum; TArray _recipient; TAssoc_array _expr; @@ -130,7 +130,8 @@ void TPostman::test_firm() if (firm != _firm) { _firm = firm; - _recipients_ok = FALSE; + _recipients_lognum = 0; + _recipient.destroy(); } } @@ -156,9 +157,10 @@ void TPostman::add_expr(const TString& addr, bool TPostman::can_dispatch_transaction(const TRectype& rec) { test_firm(); - if (!_recipients_ok) + const int lognum = rec.num(); + if (_recipients_lognum != lognum) { - _recipients_ok = TRUE; + _recipients_lognum = lognum; _recipient.destroy(); TConfig cfg(CONFIG_DITTA, "MailTransactions"); @@ -181,7 +183,7 @@ bool TPostman::can_dispatch_transaction(const TRectype& rec) expand_sys_vars(str); const int num = str.get_int(1); - if (num != rec.num()) continue; + if (num != lognum) continue; str.get(0, addr); str.get(2, opr); @@ -196,7 +198,7 @@ bool TPostman::can_dispatch_transaction(const TRectype& rec) _recipient.destroy(d, TRUE); } } - return _recipient.items() > 0; + return !_recipient.empty(); } static int write_xml(TConfig& cfg, void* jolly) @@ -312,6 +314,9 @@ bool TPostman::dispatch_transaction(const TRectype& rec, case LF_TABCOM: case LF_TABGEN: subject << rec.get("COD"); + break; + case LF_TABMOD: + subject << '&' << rec.get("COD"); break; default: subject << rec.num(); @@ -362,12 +367,7 @@ bool TPostman::dispatch_transaction(const TRectype& rec, TSocketClient socket; char * buf = new char[1024 * 256]; -#ifdef WIN32 ostrstream stream(buf, 1024 * 256); -#else - ostringstream stream(buf); -#endif - bool ok = true; item.SetTag("m:CampoTransaction"); @@ -533,7 +533,7 @@ bool TPostman::user_can(const char* flt, const TRelation* rel) return yes_he_can; } -TPostman::TPostman() : _firm(-1), _recipients_ok(FALSE) +TPostman::TPostman() : _firm(-1), _recipients_lognum(0) { } diff --git a/include/relapp.cpp b/include/relapp.cpp index e7df72e72..ae93414ca 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -1955,6 +1955,8 @@ void TRelation_application::sheet2ini(TSheet_field &sheet,TConfig& ini) void TRelation_application::mask2ini(const TMask& m, TConfig& ini) { ini.set("Firm", get_firm(), "Transaction"); + ini.set("User", user()); + ini.set("HostName", get_hostname()); int year, release, tag, patch; if (get_version_info(year, release, tag, patch)) diff --git a/include/reprint.cpp b/include/reprint.cpp index 295af2913..b97013f5e 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -1422,7 +1422,15 @@ bool TBook::print_page(TWindow& win, size_t page) xvt_dwin_draw_image_on_pdf(w, name, &rct); } else - img->draw(w, rct); + { + if (name.ends_with(".png", true)) // Provo gestire trasparenza + { + name.custom_path(); + xvt_dwin_draw_image_on_pdf(w, name, &rct); + } + else + img->draw(w, rct); + } } continue; } @@ -1476,10 +1484,11 @@ bool TBook::print_page(TWindow& win, size_t page) xvt_dwin_draw_gradient_linear(w, &rct, ct.back_color, ct.brush.color, shade_angle); else xvt_dwin_draw_gradient_circular(w, &rct, ct.back_color, ct.brush.color, NULL); - if (ct.pen.style != PAT_HOLLOW) + if (ct.pen.style > PAT_HOLLOW) { - win.hide_brush(); - xvt_dwin_draw_rect(w, &rct); + win.hide_brush(); // Hide brush + xvt_dwin_draw_rect(w, &rct); // Draw frame only + xvt_dwin_set_cbrush(w, &ct.brush); // Restore brush } } else @@ -2422,7 +2431,14 @@ bool TReport_book::open_page() { const long height = print_section('H', 1); if (height > 0) + { _delta.y += height; + if (_delta.y >= _logical_foot_pos) // Copertina enorme? + { + close_page(); + return open_page(); + } + } } TReport_section* page_head = _report->find_section('H', 0); @@ -2540,42 +2556,45 @@ long TReport_book::print_section(TReport_section& rs) { long reprint_from = 0; // Posizione di stampa per sezione interrotte a meta' - bool page_break = _page_break_allowed && rs.page_break(); // Salto pagina "forzato" - if (!page_break && rs.level() > 0) // Controlla se il salto pagina e' "necessario" + bool page_break = false; + if (_page_break_allowed) // Calcolo un eventuale salto pagina { - long h = height; - if (rs.keep_with_next()) // Devo mantenermi con la prossima sezione + page_break = rs.page_break(); // Sezione con salto pagina "forzato" + if (!page_break && rs.level() > 0) // Controlla se il salto pagina e' "necessario" { - char next_type = 'B'; // Spesso la prossima sezione e' body 1 - int next_level = 1; - if (rs.type() == 'H') // Tento di essere piu' preciso con gli headers + long h = height; + if (rs.keep_with_next()) // Devo mantenermi con la prossima sezione { - const int maxlev = rs.report().find_max_level('H'); - if (rs.level() < maxlev) + char next_type = 'B'; // Spesso la prossima sezione e' body 1 + int next_level = 1; + if (rs.type() == 'H') // Tento di essere piu' preciso con gli headers { - next_type = 'H'; - next_level = rs.level()+1; - h += 100; // Bonus per il body successivo all'header successivo + const int maxlev = rs.report().find_max_level('H'); + if (rs.level() < maxlev) + { + next_type = 'H'; + next_level = rs.level()+1; + h += 100; // Bonus per il body successivo all'header successivo + } } + const TReport_section& next_section = rs.report().section(next_type, next_level); + if (next_section.page_break()) + h += _page_size.y; + else + h += next_section.compute_size().y; } - const TReport_section& next_section = rs.report().section(next_type, next_level); - if (next_section.page_break()) - h += _page_size.y; - else - h += next_section.compute_size().y; - } - const long space_left = (_logical_foot_pos - _delta.y)/100*100; // Calcola spazio rimasto - page_break = h > space_left; // Controlla se e' sufficiente + const long space_left = (_logical_foot_pos - _delta.y)/100*100; // Calcola spazio rimasto + page_break = h > space_left; // Controlla se e' sufficiente - // Controllo se la sezione puo' essere stampata su due pagine - if (page_break && space_left > 100 && rs.can_be_broken()) - { - reprint_from = space_left; - rs.print_clipped(*this, 0, reprint_from); + // Controllo se la sezione puo' essere stampata su due pagine + if (page_break && space_left > 100 && rs.can_be_broken()) + { + reprint_from = space_left; + rs.print_clipped(*this, 0, reprint_from); + } } } - if (page_break) { close_page(); diff --git a/include/tabapp.cpp b/include/tabapp.cpp index 359f563bd..93684971a 100755 --- a/include/tabapp.cpp +++ b/include/tabapp.cpp @@ -59,7 +59,7 @@ bool TTable_application::protected_record(TRectype& rec) TString& TTable_application::get_mask_name(TString& t) const { - CHECK(_rel,"Can't use a NULL relation to retrieve table module"); + CHECK(_rel, "Can't use a NULL relation to retrieve table module"); TString8 m = _tabname; if (m[0] == '%' || m[0] == '$') diff --git a/include/tabutil.cpp b/include/tabutil.cpp index 1f6f61fef..15991b38f 100755 --- a/include/tabutil.cpp +++ b/include/tabutil.cpp @@ -180,7 +180,7 @@ void TTable::load_module_description() } nfiles = f.items(); } - if (nfiles == 1) + if (nfiles > 0) { n = f.row(0); if (!n.exist()) @@ -193,12 +193,12 @@ void TTable::load_module_description() _module.lower(); } TScanner m(n); - bool ok = TRUE; + bool ok = true; while (ok) { const TString& l2 = m.line().left(2); if (l2.empty()) - ok = FALSE; + ok = false; else if (l2 == "PA") break; @@ -286,6 +286,6 @@ bool TTable::get_relapp(TString& app) const if (num() == LF_TABCOM) app << '%'; app << _tabname; - return app.not_empty(); + return true; } diff --git a/include/textset.cpp b/include/textset.cpp index 4db4fc906..23204a69b 100755 --- a/include/textset.cpp +++ b/include/textset.cpp @@ -297,13 +297,13 @@ TRecnotype TCSV_recordset::new_rec(const char* rec) return n; } -void TCSV_recordset::create_column(const char * name, TFieldtypes type) +void TCSV_recordset::create_column(const char* name, TFieldtypes type) { TRecordset_column_info * info = new TRecordset_column_info; info->_name = name; info->_type = type; - _trc.add(info); + info->_pos = _trc.add(info); } unsigned int TCSV_recordset::build_trc() @@ -361,8 +361,9 @@ bool TCSV_recordset::load_file(const TFilename& n) { if (!TText_recordset::load_file(n)) return false; - - return build_trc() > 0; + if (_trc.empty()) + build_trc(); + return columns() > 0; } bool TCSV_recordset::set(unsigned int column, const TVariant& var) diff --git a/include/xvtility.cpp b/include/xvtility.cpp index 6f9e89dcb..8a328a76d 100755 --- a/include/xvtility.cpp +++ b/include/xvtility.cpp @@ -72,10 +72,13 @@ RCT& resize_rect( { if (x > 0 || (wt != WO_TE && wt != W_PLAIN && x == 0)) { - RCT pc; xvt_vobj_get_client_rect(parent, &pc); // Get parent window size - const int width = pc.right; - const int tot = 80*CHARX; - if (width > tot) x += (width-tot) / (CHARX<<1); + if (!is_full_screen_interface(parent)) // Not Full screen? + { + RCT pc; xvt_vobj_get_client_rect(parent, &pc); // Get parent window size + const int width = pc.right; + const int tot = 80*CHARX; + if (width > tot) x += (width-tot) / (CHARX<<1); + } } } wt = WC_TEXTEDIT; // Campo di maschera