diff --git a/include/checks.cpp b/include/checks.cpp index bac805374..256eb403e 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/clifo.h b/include/clifo.h index 89a517eaa..ae9489ff1 100755 --- a/include/clifo.h +++ b/include/clifo.h @@ -73,8 +73,5 @@ #define CLI_ENTE "ENTE" #define CLI_AUTORIZ "AUTORIZ" -#define CLI_PADESTIN "PADESTIN" -#define CLI_PARIFAMM "PARIFAMM" - #endif diff --git a/include/confapp.cpp b/include/confapp.cpp index fbaa69571..5cdcf059e 100755 --- a/include/confapp.cpp +++ b/include/confapp.cpp @@ -152,17 +152,26 @@ void TConfig_application::do_config(int m) _parag.cut(2); load_config(); + + TMask* mask = NULL; + + TFilename maskname = get_mask_name(); + maskname.ext("msk"); + if (maskname.custom_path()) + { + mask = get_mask(); + if (mask == NULL || mask != _m) + mask = create_mask(maskname); + } + + if (mask == NULL) + { + cantread_box(maskname); + return; + } + for (;;) { - TFilename maskname = get_mask_name(); - maskname.ext("msk"); - - if (maskname.not_empty() && maskname.exist()) - { - TMask* mask = get_mask(); - if (mask == NULL || mask != _m) - mask = create_mask(maskname); - // carica campi load_mask(); // run mask @@ -183,12 +192,6 @@ void TConfig_application::do_config(int m) } if (k == K_QUIT) break; - } - else - { - warning_box("Nessun parametro da configurare"); - break; - } } } diff --git a/include/config.cpp b/include/config.cpp index 765ac8150..12fb47b48 100755 --- a/include/config.cpp +++ b/include/config.cpp @@ -12,7 +12,7 @@ bool TConfig::add_line(const TString& l) { const int ind = l.find('='); if (ind < 0) - return FALSE; + return false; TString256 key = l.left(ind); key.trim(); TString val = l.mid(ind+1); val.trim(); @@ -34,7 +34,7 @@ bool TConfig::add_line(const TString& l) } } // sostituzione abilitata - return _data.add(key,val,TRUE); + return _data.add(key,val,true); } // @doc EXTERNAL @@ -162,7 +162,7 @@ void TConfig::_write_file() if (fexist(_file)) { while (xvt_fsys_access(_file, 02) != 0) - message_box("Il file %s e' gia' in uso", (const char*)_file); + message_box("Il file %s è già in uso", (const char*)_file); } fcopy(temp, _file); // Copia dalla tempdir al nuovo .ini ::remove(temp); // Cancella file temporaneo diff --git a/include/doc.h b/include/doc.h index 587752a90..bebcfda02 100755 --- a/include/doc.h +++ b/include/doc.h @@ -98,6 +98,8 @@ #define DOC_CONTRATTO "CONTRATTO" #define DOC_PAF "PAF" #define DOC_MANDATO "MANDATO" +#define DOC_COMMPREL "COMMPREL" +#define DOC_FASEPREL "FASEPREL" // Virtuali diff --git a/include/golem.cpp b/include/golem.cpp index dd2edf568..68196a5b2 100755 --- a/include/golem.cpp +++ b/include/golem.cpp @@ -1099,7 +1099,21 @@ TMail_message::TMail_message(const char* recipient, const char* subject, { add_recipient(recipient); if (text && *text) - add(text); + { + const TFixed_string s(text); + if (s.find("=3D") > 0) + { + TString str(text); + for (int pos = str.find("=3D"); pos > 0; pos = str.find("=3D", pos+1)) + { + char *buf = str.get_buffer(); + strcpy_s(buf + pos + 1, str.size()-pos, buf + pos + 3); + } + add(str); + } + else + add(text); + } } /////////////////////////////////////////////////////////// diff --git a/include/isam.cpp b/include/isam.cpp index ac6c6fd98..8d24dad00 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -3019,9 +3019,9 @@ int TSystemisamfile::dump( TString s(512); bool fixedlen = (fs == '\0'); int nflds = curr().items(); - TString_array fld(nflds); + TString_array fld(nflds); TBit_array rjust(nflds); - int len[MaxFields]; + int len[MaxFields]; int j = 0; FOR_EACH_TOKEN(field_list, str) @@ -3030,11 +3030,11 @@ int TSystemisamfile::dump( fld.add(fldname); const TFieldtypes t = curr().type(fldname); - rjust.set(j, t == _intfld || t == _longfld || t == _realfld || - t == _wordfld || t == _intzerofld || t == _longzerofld); + rjust.set(j, t == _intfld || t == _longfld || t == _realfld || + t == _wordfld || t == _intzerofld || t == _longzerofld); len[j++] = (t == _datefld) ? 10 : curr().length(fldname); if (fixedlen && t == _memofld) - return error_box(TR("Non e' possibile scaricare a lunghezza fissa un file con campi memo")); + return error_box(TR("Non è possibile scaricare a lunghezza fissa un file con campi memo")); } TRecnotype i = 0; const TRecnotype nitems = items(); diff --git a/include/mask.cpp b/include/mask.cpp index 5b34fc6e1..def669dc5 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -832,7 +832,7 @@ long TMask::handler(WINDOW w, EVENT* ep) for (int f = fields()-1; f >= 0; f--) { TMask_field& cur_fld = fld(f); - if (cur_fld.shown() && cur_fld.parent() == w) + if (cur_fld.shown() && cur_fld.parent() == w && cur_fld.is_operable()) { RCT rct; cur_fld.get_rect(rct); if (xvt_rect_has_point(&rct, ep->v.mouse.where)) @@ -1911,6 +1911,13 @@ void TMask::autosave(TRelation& r) const if (save) ((TLoadable_field*)f)->autosave(r); } + + TRectype& rec = r.curr(); + if (rec.exist("DATAAGG")) + { + rec.put("DATAAGG", TDate(TODAY)); + rec.put("UTENTE", user()); + } } void TMask::on_firm_change() diff --git a/include/maskfld.cpp b/include/maskfld.cpp index d6e32e0f1..ed6f57a0a 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -3162,7 +3162,7 @@ const char* TReal_field::reformat(const char* data) const else { const real r(data); // Gestione standard dei reali - str = r.string(0, decimals()); + str = r.string(0, d); } if (_flags.zerofilled) { diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 25d8efd7d..e195cde37 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -3337,7 +3337,6 @@ void TSheet_field::mask2row(int n, TToken_string & rec) if (active() && s.active()) { const int col = cid2index(id); - if (!s.column_disabled(col)) { const bool on = f.enabled(); @@ -3349,7 +3348,14 @@ void TSheet_field::mask2row(int n, TToken_string & rec) } #ifdef DBG if (pos < 0 && s.cid2col(id) > 0) + { + static short _last_cid = 0; + if (id != _last_cid) + { + _last_cid = id; yesnofatal_box("Mask2row: Non e' visibile il campo %d", id); + } + } #endif } else diff --git a/include/odbcrset.cpp b/include/odbcrset.cpp index 5c38fa17b..beea76ddf 100755 --- a/include/odbcrset.cpp +++ b/include/odbcrset.cpp @@ -388,6 +388,12 @@ void TODBC_recordset::parsed_text(TString& sql) const } } +bool TODBC_recordset::set_log_file(const char* fn) +{ + XVT_ODBC h = connection(); + return xvt_odbc_log_file(h, fn) != 0; +} + void TODBC_recordset::set(const char* sql) { reset(); diff --git a/include/odbcrset.h b/include/odbcrset.h index 6f025f04b..f98277ba9 100755 --- a/include/odbcrset.h +++ b/include/odbcrset.h @@ -44,6 +44,7 @@ public: long exec(const char* sql); bool connect(const char* dsn, const char* usr = "", const char* pwd = "", const char* dir = ""); + bool set_log_file(const char* fn); const TString& dsn() const { return _dsn; } diff --git a/include/printer.cpp b/include/printer.cpp index 2b010e962..4980efc99 100755 --- a/include/printer.cpp +++ b/include/printer.cpp @@ -188,7 +188,7 @@ bool TPrinter_setup_mask::on_field_event(TOperable_field& o, TField_event e, lon const int fs = atoi(o.get()); const int ls = 72 / get_int(MSK_LINES); if (fs < ls/2 || fs > 4*ls/3) - ok = yesno_box(TR("La dimensione del carattere non e' adeguata all'interlinea\nSi desidera continuare ugualmente?")); + ok = yesno_box(TR("La dimensione del carattere non è adeguata all'interlinea\nSi desidera continuare ugualmente?")); } break; case DLG_SETPRINT: diff --git a/include/relapp.cpp b/include/relapp.cpp index 8d872849f..86067cc5e 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -1752,6 +1752,8 @@ bool TRelation_application::parse_command_line() if ((ini[0] == '-' || ini[0] == '/') && (ini[1] == 'I' || ini[1] == 'i')) { ini.ltrim(2); + if (ini.starts_with("=")) + ini.ltrim(1); CHECK(!ini.blank(),"Manca l'indicazione della transazione. Il nome va indicato di seguito al -i, senza interporre spaziatura."); if (ini.find('*')>=0) { @@ -1759,7 +1761,12 @@ bool TRelation_application::parse_command_line() list_files(ini, _trans_ini); } else - _trans_ini.add(ini); + { + if (ini.exist()) + _trans_ini.add(ini); + else + cantread_box(ini); + } break; } } diff --git a/include/reprint.cpp b/include/reprint.cpp index 5f5573fba..d713247a6 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -2940,7 +2940,7 @@ bool TReport_book::add(TReport& rep, bool progind) for (int a = 0; a < all.items(); a++) { TFilename name = all.row(a); - if (name.find('#') >= 0) // Se puo' essere un'espressione + if (name.find('(') >= 0 || name.find('#') >= 0) // Se puo' essere un'espressione { TVariant var; if (_report->evaluate(name, var, _alfafld)) diff --git a/include/strings.h b/include/strings.h index 574cd07ad..4ac6c0cce 100755 --- a/include/strings.h +++ b/include/strings.h @@ -325,7 +325,7 @@ public: // si rimanda a tale classe per ulteriori spiegazioni. class TString4 : public TFixed_string { - char _str4[5]; + char _str4[8]; public: TString4(const char* s = "") : TFixed_string(_str4, 5) { set(s); } @@ -349,7 +349,7 @@ public: // si rimanda a tale classe per ulteriori spiegazioni. class TString8 : public TFixed_string { - char _str8[9]; + char _str8[12]; public: TString8(const char* s = "") : TFixed_string(_str8, 9) { set(s); } @@ -372,7 +372,7 @@ class TString16 : public TFixed_string // @access:(INTERNAL) Private member // @cmember:(INTERNAL) Stringa di 16 caratteri - char _str16[17]; + char _str16[20]; // @access Public Member public: @@ -403,6 +403,29 @@ public: // gli stessi, la differenza e' solo nel numero di caratteri della stringa. }; +class TString20 : public TFixed_string +{ + char _str20[24]; + +protected: + virtual TObject* dup() const { return new TString20(_str20); } + +public: + TString20(const char* s = "") : TFixed_string(_str20, 21) + { set(s); } + TString20(const TString& s) : TFixed_string(_str20, 21) + { set(s); } + TString20(const TString20& s) : TFixed_string(_str20, 21) + { set(s); } + const TString& operator =(const char* s) + { return set(s); } + const TString& operator =(const TString& s) + { return set((const char*)s); } + const TString& operator =(const TString20& s) + { return set((const char*)s); } +}; + + // @doc EXTERNAL // @class TString80 | Definisce le stringhe di 80 caratteri @@ -415,7 +438,7 @@ public: // si rimanda a tale classe per ulteriori spiegazioni. class TString80 : public TFixed_string { - char _str80[81]; + char _str80[84]; public: // @cmember Duplica una stringa di 80 caratteri @@ -441,7 +464,7 @@ public: // si rimanda a tale classe per ulteriori spiegazioni. class TString256 : public TFixed_string { - char _str256[257]; + char _str256[260]; public: // @cmember Duplica una stringa di 256 caratteri diff --git a/include/varmask.cpp b/include/varmask.cpp index 13a0dfea9..8d6c6679b 100755 --- a/include/varmask.cpp +++ b/include/varmask.cpp @@ -10,25 +10,25 @@ const TString& TVariable_mask::get(short fld_id) const void TVariable_mask::set_handler(short fld_id, CONTROL_HANDLER handler) { - if(present( fld_id )) + if (present(fld_id)) TMask::set_handler( fld_id, handler ); } void TVariable_mask::set(short fld_id, const char* str, byte hit) { - if(present( fld_id )) - TMask::set( fld_id, str, hit ); + if (present(fld_id)) + TMask::set(fld_id, str, hit); } void TVariable_mask::show(short fld_id, bool on ) { - if(fld_id < 0 || present( fld_id ) ) + if (fld_id < 0 || present( fld_id ) ) TMask::show( fld_id, on ); } void TVariable_mask::reset(short fld_id) { - if(fld_id <= 0 || present( fld_id ) ) + if (fld_id <= 0 || present( fld_id ) ) TMask::reset( fld_id); } diff --git a/include/varrec.cpp b/include/varrec.cpp index 75588be75..899af31b6 100755 --- a/include/varrec.cpp +++ b/include/varrec.cpp @@ -294,7 +294,7 @@ const TString & TVariable_rectype::get_str(const char* fieldname) const { if (TRectype::exist(s)) // Campo ex-virtuale ora diventato reale { - CHECKS(TRectype::get(s).empty(), "Campo ex-virtuale pieno ", s); + //CHECKS(TRectype::get(s).empty(), "Campo ex-virtuale pieno ", s); ((TRectype*)this)->TRectype::put(s, val); } else diff --git a/include/xml.cpp b/include/xml.cpp index abfc17259..932aa8825 100755 --- a/include/xml.cpp +++ b/include/xml.cpp @@ -579,7 +579,8 @@ TXmlItem* TXmlItem::FindFirst(const char* strTag) const TXmlItem* TXmlItem::FindFirstChild(const char* strTag) const { - for (int i = 0; i < GetChildren(); i++) + const int n = GetChildren(); + for (int i = 0; i < n; i++) { TXmlItem* c = GetChild(i); if (c->GetTag() == strTag) @@ -588,7 +589,6 @@ TXmlItem* TXmlItem::FindFirstChild(const char* strTag) const return NULL; } - TXmlItem::TXmlItem() : m_strTag(15), m_strText(NULL), m_Attributes(NULL), m_Children(NULL) { }