Ricorretto cambio ditta che non permetteva conversione

git-svn-id: svn://10.65.10.50/branches/R_10_00@23153 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2015-12-16 15:54:37 +00:00
parent 8da6ac7473
commit 062241ade5
9 changed files with 4425 additions and 4380 deletions

View File

@ -1,3 +1,4 @@
#pragma once
#ifndef __ARRAY_H
#define __ARRAY_H

View File

@ -189,6 +189,11 @@ bool TAssoc_array::add(
delete o->_obj;
o->_obj = obj;
}
else
{
NFCHECK("deleting duplicate hash object");
delete obj;
}
return true;
}
o->_obj = obj;
@ -197,12 +202,29 @@ bool TAssoc_array::add(
bool TAssoc_array::add(const char* key, const TObject& obj, bool force)
{
/*
// Non inserire l'Hash_object se non lo trovi (ci pensa la add sotto)
bool isnew = false;
_lookup(key,isnew,false);
if (!isnew && !force)
return true;
return add(key,obj.dup(),force);
*/
bool isnew = false;
THash_object* o = _lookup(key, isnew, true);
if (!isnew)
{
if (force)
{
if (o->_obj != NULL)
delete o->_obj;
o->_obj = obj.dup();
}
return true;
}
o->_obj = obj.dup();
return false;
}
// @doc EXTERNAL

View File

@ -1366,10 +1366,7 @@ TGroupbox_control::TGroupbox_control(WINDOW win, short cid,
{
XI_OBJ* itf = get_interface(win);
XI_RCT rct = coord2rct(itf, left, top, width, height);
//rct.top = _obj->v.text->xi_rct.bottom - 2;
rct.top += XI_FU_MULTIPLE;
rct.bottom -= XI_FU_MULTIPLE / 2;
XI_OBJ_DEF* def = xi_add_rect_def(NULL, cid, &rct, XI_ATR_VISIBLE, 0, 0); // Ignore colors
@ -1391,13 +1388,15 @@ TGroupbox_control::TGroupbox_control(WINDOW win, short cid,
_rct = xi_create(itf, def);
CHECKD(_rct, "Can't create Groupbox_control ", cid);
XI_RCT& rt = _obj->v.text->rct;
//rt.top--; rt.bottom--;
const int txt_height = rt.bottom-rt.top;
rt.bottom = _rct->v.rect->rct.top - 1;
rt.top = rt.bottom - txt_height + 2;
rt.left = _rct->v.rect->rct.left;
rt.right = _rct->v.rect->rct.right;
XI_RCT& rt = _obj->v.text->rct; // Rettangolo testo
XI_RCT& rr = _rct->v.rect->rct; // Rettangolo box
rr.top -= 2;
//const int txt_height = rt.bottom-rt.top;
rt.bottom = rr.top - 1;
//rt.top = rt.bottom - txt_height + 2;
rt.left = rr.left;
rt.right = rr.right;
xi_dequeue();
xi_tree_free(def);

View File

@ -132,12 +132,15 @@ void TDowJones::test_cache()
}
if (_euro_val.empty()) // Si son dimenticati dell'EURO?
{
TExchangeData* euro = new TExchangeData;
euro->_chg = UNO; euro->_dec = euro->_dec_prices = 2;
euro->_is_euro = true;
{
_euro_val = "EUR";
_cache.add(_euro_val, euro);
if (!_cache.is_key(_euro_val))
{
TExchangeData* euro = new TExchangeData;
euro->_chg = UNO; euro->_dec = euro->_dec_prices = 2;
euro->_is_euro = true;
_cache.add(_euro_val, euro);
}
}
if (_firm_val.empty())
_firm_val = _euro_val;

File diff suppressed because it is too large Load Diff

View File

@ -494,7 +494,7 @@ const TFilename& TFile_info::load_filedes()
{
_dir = _filedes.SysName[0] != '$' ? _comdir : _nordir;
_name = CAddPref(_filedes.SysName);
strncpy_s(_filedes.Des, sizeof(_filedes.Des), dictionary_translate(_filedes.Des), sizeof(_filedes.Des)-1);
strncpy(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des)-1);
}
else
_name.cut(0);
@ -533,8 +533,8 @@ TFile_info::TFile_info(int logicnum, TFilename& name)
int err = DB_recinfo(_name, &_filedes, (RecDes*)&rec.rec(), keys.get_buffer());
if (err == NOERR && prefix().add_recdes(logicnum, rec, keys))
{
strncpy_s(_filedes.SysName, sizeof(_filedes.SysName), _name, sizeof(_filedes.SysName));
_filedes.SysName[sizeof(_filedes.SysName)-1] = '\0';
strncpy(_filedes.SysName, _name, sizeof(_filedes.SysName));
_filedes.SysName[41] = '\0';
}
else
_name.cut(0);
@ -800,15 +800,12 @@ long TFile_manager::last_change(TIsam_handle name) const
return i.last_change();
}
int TFile_manager::close_closeable(bool firm_only)
int TFile_manager::close_closeable()
{
_open_files = 0; // Ricalcolo per sicurezza
for (TIsam_handle n = _fileinfo.last(); n > 0; n = _fileinfo.pred(n))
{
TFile_info& i = fileinfo(n);
if (firm_only && i.dir_type() != _nordir)
continue;
if (i.is_open())
{
_open_files++;
@ -824,9 +821,9 @@ int TFile_manager::close_closeable(bool firm_only)
return _open_files;
}
void TFile_manager::close_all(bool firm_only)
void TFile_manager::close_all()
{
const int zoccolo_duro = close_closeable(firm_only);
const int zoccolo_duro = close_closeable();
#ifdef DBG
if (zoccolo_duro > 0)
NFCHECK("%d files refuse to be closed!", zoccolo_duro);
@ -835,8 +832,6 @@ void TFile_manager::close_all(bool firm_only)
for (int n = _recinfo.last(); n > 0; n = _recinfo.pred(n))
{
const TRecord_info& r = recinfo(n);
if (firm_only && r.dir_type() != _nordir)
continue;
if (r.mutable_dir())
_recinfo.destroy(n);
}
@ -1021,15 +1016,14 @@ void TPrefix::set(
return;
if (_prefix != ".")
{
const bool firm_only = !xvt_str_same(name, "COM") && !xvt_str_same(name, "DEF");
_manager.close_all(firm_only);
_manager.close_all();
CCloseDir(NORDIR);
CCloseDir(COMDIR);
CCloseRecDir(NORDIR);
CCloseRecDir(COMDIR);
}
if (xvt_str_same(name, "DEF"))
if (strcmp(name, "DEF") == 0)
{
const char* prfx = CGetPref();
xvt_fsys_parse_pathname(prfx, NULL, NULL, _prefix.get_buffer(), NULL, NULL);
@ -1041,7 +1035,7 @@ void TPrefix::set(
{
const TString saved_prf = __ptprf; // Salvo __ptprf che viene cambiato da CGetPref
char* prfx = (char*)CGetPref(); // Safe non const cast for StPath cprefix
strcpy_s(__ptprf, sizeof(__ptprf), saved_prf);
strcpy(__ptprf, saved_prf);
xvt_fsys_build_pathname(prfx, NULL, __ptprf, _prefix, NULL, NULL);
}
else
@ -1086,11 +1080,12 @@ bool TPrefix::exist(long codditta) const
bool TPrefix::test(const char* s) const
{
if (s && *s && !xvt_str_same(s, "DEF"))
if (s && *s && strcmp(s, "DEF") != 0)
{
TFilename s1(__ptprf);
s1.add(s);
s1.add("dir.gen");
s1.add("dir.gen");
if (s1.exist())
{
if (xvt_fsys_access(s1, 0x2) != 0)
@ -1171,7 +1166,7 @@ bool TPrefix::set_studio(const char* study, long ditta)
const TString old_study(__ptprf);
const TString old_firm(_prefix);
strcpy_s(__ptprf, sizeof(__ptprf), study);
strcpy(__ptprf, study);
const word len = strlen(__ptprf);
if (len > 0 && __ptprf[len-1] != '\\' && __ptprf[len-1] != '/')
{
@ -1184,7 +1179,7 @@ bool TPrefix::set_studio(const char* study, long ditta)
bool ok = set_codditta(ditta, TRUE);
if (!ok)
{
strcpy_s(__ptprf, sizeof(__ptprf), old_study);
strcpy(__ptprf, old_study);
set(old_firm, true);
}
return ok;

View File

@ -54,8 +54,8 @@ public:
void notify_change(TIsam_handle name);
long last_change(TIsam_handle name) const;
int close_closeable(bool firm_only = false);
void close_all(bool firm_only = false);
int close_closeable();
void close_all();
void open_all();
TFile_manager();
@ -138,16 +138,19 @@ public:
// @cmember Setta lo studio corrente
bool set_studio(const char* study, long firm = 0);
// @cmember Ritorna il contenuto della variabile <p _prefix>
const char* name() const { return _prefix; }
const char* name() const
{ return _prefix;}
// @cmember Ritorna il livello degli archivi
unsigned int filelevel() const { return _filelevel; }
unsigned int filelevel() const
{return _filelevel;}
// @cmember Ritorna il livello standard degli archivi
unsigned int get_stdlevel() const { return _stdlevel; }
void set_stdlevel(unsigned int sl) { _stdlevel = sl; }
// @cmember Ritorna il numero di archivi
int items() const { return _items; }
int items() const
{ return _items; }
// @cmember Ritorna la descrizione del file passato
const char* description(const char* cod) const;
// @cmember Ritorna la descrizione del file passato
@ -163,7 +166,7 @@ public:
// @cmember Riapre tutti gli archivi della ditta attiva
void reopen() const ;
TIsam_handle open_isamfile(int& logicnum, TFilename& name, bool excl = false, bool idx = true)
TIsam_handle open_isamfile(int& logicnum, TFilename& name, bool excl = FALSE, bool idx = TRUE)
{ return _manager.open(logicnum, name, excl, idx); }
int close_isamfile(TIsam_handle& name)

View File

@ -552,7 +552,7 @@ bool TRelation_application::modify_mode()
if (err != NOERR)
{
if (err == _islocked)
message_box(TR("I dati sono gia' usati da un altro programma"));
message_box(TR("I dati sono già usati da un altro utente"));
else
error_box(FR("Impossibile leggere i dati: errore %d"), err);
if (!is_transaction())

View File

@ -289,12 +289,12 @@ HIDDEN bool _cf_val(TMask_field& f, KEY key)
bool ok = true;
if (cf.empty()) return true;
if (cf.len() == 11 && isdigit(cf[0]))
if (isdigit(cf[0]) && cf.len() >= 11)
{
const TString& stato = get_fld_val_param(f, 0);
if (stato.full() && stato != "IT")
return true;
ok = pi_check (stato, cf);
ok = pi_check(stato, cf);
}
else
ok = __cf_check(cf);
@ -302,7 +302,7 @@ HIDDEN bool _cf_val(TMask_field& f, KEY key)
{
if(f.dirty())
{
ok = f.noyes_box(TR("Codice fiscale errato: si desidera accettarlo ugualmente?"));
ok = f.yesno_box(TR("Codice fiscale errato: si desidera accettarlo ugualmente?"));
if (ok) f.set_dirty(false);
}
else