Correzioni a tutto campo
git-svn-id: svn://10.65.10.50/branches/R_10_00@22905 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
530c414206
commit
2d9e19f537
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 <pos>
|
||||
void add_output_field(const char * id, const char * name, const int pos = -1);
|
||||
|
||||
|
@ -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
|
||||
|
@ -139,7 +139,7 @@ bool yesnofatal_box(
|
||||
//
|
||||
// @xref <m yesno_box> <m yesnofatal_box>
|
||||
{
|
||||
buildmsg();
|
||||
buildmsg();
|
||||
|
||||
#ifdef DBG
|
||||
char user[32]; xvt_sys_get_user_name(user, sizeof(user));
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
#endif
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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 <p _files> del numero logico passato
|
||||
|
@ -31,7 +31,6 @@
|
||||
#define PCN_CODCMS "CODCMS"
|
||||
#define PCN_FASCMS "FASCMS"
|
||||
#define PCN_ANALITICA "ANALITICA"
|
||||
#define PCN_SERVIZI "SERVIZI"
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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();
|
||||
|
@ -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] == '$')
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user