diff --git a/include/applicat.cpp b/include/applicat.cpp index 5e1cb96da..a1f62307b 100755 --- a/include/applicat.cpp +++ b/include/applicat.cpp @@ -821,10 +821,10 @@ bool TApplication::get_next_pdf(int anno, long ditta, const char* codnum, } bool TApplication::get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn, - TString& subj, TString& text, TToken_string& attach, bool& ui) const + TString& subj, TString& text, TToken_string& attach, short& ui) const { - bool ok = dongle().active(RSAUT); - ui = ok && to.blank(); + const bool ok = dongle().active(RSAUT); + ui = ok && to.blank() ? 0x1 : 0x0; // Forza finestra di dialogo in assenza di destinatario return ok; } diff --git a/include/applicat.h b/include/applicat.h index be32500ea..9442c6b07 100755 --- a/include/applicat.h +++ b/include/applicat.h @@ -125,7 +125,7 @@ public: virtual bool get_next_pdf(int anno, long ditta, const char* codnum, long numdoc, long codcf, TFilename& pdf) const; virtual bool get_next_mail(TToken_string& to, TToken_string& cc, TToken_string& ccn, - TString& subj, TString& text, TToken_string& attach, bool& ui) const; + TString& subj, TString& text, TToken_string& attach, short& flags) const; // @cmember Controlla se al programma corrente e' concesso cambiare ditta da menu. virtual bool firm_change_enabled() const; diff --git a/include/effetti.h b/include/effetti.h index 3dc34464b..b99e2dedf 100755 --- a/include/effetti.h +++ b/include/effetti.h @@ -28,8 +28,8 @@ #define EFF_NUMREG "NUMREG" #define EFF_CODABIP "CODABIP" #define EFF_CODCABP "CODCABP" -#define EFF_DATARIBA "DATARIBA" #define EFF_PROGBNP "PROGBNP" +#define EFF_DATARIBA "DATARIBA" #define EFF_DISRIBAEST "DISRIBAEST" #define EFF_IMPORTO "IMPORTO" #define EFF_IMPORTOVAL "IMPORTOVAL" diff --git a/include/form.h b/include/form.h index e58a2ae3a..4ff3ca06e 100755 --- a/include/form.h +++ b/include/form.h @@ -871,7 +871,7 @@ public: bool has_memo() const { return _flag.memo; } - virtual bool is_section() const { return FALSE; } + virtual bool is_section() const { return false; } // virtual short& x() { return _x; }; @@ -948,7 +948,7 @@ public: { return _prompt; } // @cmember Setta il prompt del campo virtual bool set(const char* s) - { _prompt = s; return TRUE; } + { _prompt = s; return true; } // @cmember Ritorna un esempio del formato corrente virtual const char* example() const diff --git a/include/golem.cpp b/include/golem.cpp index 858682822..d69bee6d3 100755 --- a/include/golem.cpp +++ b/include/golem.cpp @@ -1007,6 +1007,9 @@ bool TMail_message::send(TMAPI_session& lhSession, bool hide_ui) msgSend.lpRecips = nr == 0 ? NULL : msgRecipient; msgSend.nFileCount = na; msgSend.lpFiles = na == 0 ? NULL : msgAttachment; + + if (receipt_requested()) + msgSend.flFlags |= MAPI_RECEIPT_REQUESTED; bool ok = lhSession.send(msgSend, hide_ui ? 0 : MAPI_DIALOG); @@ -1112,7 +1115,7 @@ const TString& TMail_message::recipient(int n) const TMail_message::TMail_message(const char* recipient, const char* subject, const char* text, const char* sender) - : _subject(subject), _sender(sender), _hms(0) + : _subject(subject), _sender(sender), _hms(0), _query_receipt(false) { add_recipient(recipient); if (text && *text) @@ -1200,6 +1203,7 @@ int TMail_messages::get(const char* senderFilter, TMail_message* msg = new TMail_message(recipient, subject, body, sender); msg->set_date_time(pMessage->lpszDateReceived); msg->set_id(msg_id); + msg->query_receipt((pMessage->flFlags & MAPI_RECEIPT_REQUESTED) != 0); add(msg); } diff --git a/include/golem.h b/include/golem.h index 58cb45cf5..94b5a4b49 100755 --- a/include/golem.h +++ b/include/golem.h @@ -23,6 +23,7 @@ class TMail_message : public TString_array TString _id; TDate _date; long _hms; + bool _query_receipt; protected: bool add_recipient_ex(const char* recipient, int type); @@ -38,7 +39,8 @@ public: bool attach(const char* filename) { return add_recipient_ex(filename, 2); } void set_sender(const char* address) { _sender = address; _sender.trim(); } void set_id(const char* id) { _id = id; } - int add_line(const char * s); + void query_receipt(bool qr) { _query_receipt = qr; } + int add_line(const char * s); TMail_message& operator = (const char* msg) { destroy(); add(msg); return *this; } TMail_message& operator = (const TString& msg) { destroy(); add(msg); return *this; } @@ -49,6 +51,7 @@ public: const TString& sender() const { return _sender; } const TString& subject() const { return _subject; } const TString& id() const { return _id; } + bool receipt_requested() const { return _query_receipt; } void set_date_time(const char* date_time); void set_date_time(const TDate& date, long hhmmss = 0); diff --git a/include/msksheet.cpp b/include/msksheet.cpp index 89fd3b00c..080425104 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -637,9 +637,13 @@ int TSpreadsheet::row2rec(int& row) { int rows; const long* handle = xi_get_list_info(_obj, &rows); + if (rows <= 0) + return -1; // Empty sheet if (row < 0) + { row = 0; + } else { if (row >= rows) diff --git a/include/msksheet.h b/include/msksheet.h index 43a39ac4f..424404008 100755 --- a/include/msksheet.h +++ b/include/msksheet.h @@ -292,10 +292,12 @@ public: virtual ~TSheet_field(); }; -#define FOR_EACH_SHEET_ROW(__sheet, __r, __riga) \ - FOR_EACH_ARRAY_ROW((__sheet).rows_array(), __r, __riga) +#define FOR_EACH_SHEET_ROW(__sheet, __r, __riga) \ + TString_array& __sheet##__riga = (__sheet).rows_array(); \ + FOR_EACH_ARRAY_ROW(__sheet##__riga, __r, __riga) -#define FOR_EACH_SHEET_ROW_BACK(__sheet, __r, __riga) \ - FOR_EACH_ARRAY_ROW_BACK((__sheet).rows_array(), __r, __riga) +#define FOR_EACH_SHEET_ROW_BACK(__sheet, __r, __riga) \ + TString_array& __sheet##__riga = (__sheet).rows_array(); \ + FOR_EACH_ARRAY_ROW_BACK(__sheet##__riga, __r, __riga) #endif diff --git a/include/spotlite.cpp b/include/spotlite.cpp index 389c0a55c..2eb520fb7 100755 --- a/include/spotlite.cpp +++ b/include/spotlite.cpp @@ -102,12 +102,12 @@ bool spotlite_send_mail(const TFilename& pdf) { TToken_string to(15, ';'), cc(15, ';'), ccn(15, ';'), attach(pdf, ';'); TString subj, text; - bool ui = true; - bool ok = main_app().get_next_mail(to, cc, ccn, subj, text, attach, ui); + short flags = 0x1; // UI + bool ok = main_app().get_next_mail(to, cc, ccn, subj, text, attach, flags); if (subj.blank()) subj.cut(0) << TR("Invio di ") << pdf.name(); - if (!ui && to.empty_items() && cc.empty_items() && ccn.empty_items()) - ui = true; - ok = xvt_mail_send(to, cc, ccn, subj, text, attach, ui) != 0; + if (!(flags & 0x1) && to.empty_items() && cc.empty_items() && ccn.empty_items()) + flags |= 0x1; // Forza UI in assenza di destinatari + ok = xvt_mail_send(to, cc, ccn, subj, text, attach, flags) != 0; return ok; }