Patch level : 2.1
Files correlati : librerie Ricompilazione Demo : [ ] Commento : Risolti conflitti ovunque git-svn-id: svn://10.65.10.50/trunk@11868 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4943e6b674
commit
d5386bd82b
@ -365,41 +365,6 @@ void CPutRec(logicname,recd,dirflg)
|
||||
CWrite(&rdir[dirflg],(RecType) recd,(long) logicname, NoLock);
|
||||
}
|
||||
|
||||
int CGetCampoStpValue(const char* name, char* value, int valsize)
|
||||
{
|
||||
BOOLEAN bFound = FALSE;
|
||||
#ifdef WIN32
|
||||
const char* stpfile = "c:/campo.stp";
|
||||
int p;
|
||||
DIRECTORY dir;
|
||||
char exedir[_MAX_PATH], path[_MAX_PATH];
|
||||
xvt_fsys_get_default_dir(&dir);
|
||||
xvt_fsys_convert_dir_to_str(&dir, exedir, sizeof(exedir));
|
||||
|
||||
for (p = 1; ; p++)
|
||||
{
|
||||
int len = 0;
|
||||
char para[4]; sprintf(para, "%d", p);
|
||||
len = xvt_sys_get_profile_string(stpfile, para, "Program", "", path, sizeof(path));
|
||||
if (len <= 0)
|
||||
break;
|
||||
if (path[len-1] == '\\' || path[len-1] == '/')
|
||||
{
|
||||
len--;
|
||||
path[len] = '\0';
|
||||
}
|
||||
if (xvt_str_compare_ignoring_case(path, exedir) == 0)
|
||||
{
|
||||
xvt_sys_get_profile_string(stpfile, para, name, "", value, valsize);
|
||||
bFound = *value > ' ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
return bFound;
|
||||
}
|
||||
|
||||
/*
|
||||
@($) CGetCampoIni FILES
|
||||
|
||||
@ -415,50 +380,7 @@ int CGetCampoStpValue(const char* name, char* value, int valsize)
|
||||
*/
|
||||
const char* CGetCampoIni(void)
|
||||
{
|
||||
static char* prawin = NULL;
|
||||
if (prawin == NULL)
|
||||
{
|
||||
char exedir[_MAX_PATH], path[_MAX_PATH];
|
||||
DIRECTORY dir;
|
||||
#ifdef WIN32
|
||||
BOOLEAN bFound = FALSE;
|
||||
#endif
|
||||
|
||||
// Nelle installazioni sfigate con programmi in rete cerca di stabilire il percorso locale di Campo.ini
|
||||
xvt_fsys_get_default_dir(&dir);
|
||||
xvt_fsys_convert_dir_to_str(&dir, exedir, sizeof(exedir));
|
||||
#ifdef WIN32
|
||||
if (xvt_fsys_is_network_drive(exedir))
|
||||
{
|
||||
bFound = CGetCampoStpValue("CampoIni", path, sizeof(path));
|
||||
if (!bFound)
|
||||
{
|
||||
const char* pp = getenv("PREFPATH");
|
||||
if (pp != NULL)
|
||||
{
|
||||
char dri[_MAX_DRIVE], dir[_MAX_PATH];
|
||||
xvt_fsys_parse_pathname(pp, dri, dir, NULL, NULL, NULL);
|
||||
xvt_fsys_build_pathname(path, dri, dir, "campo", "ini", NULL);
|
||||
bFound = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!bFound)
|
||||
{
|
||||
#endif
|
||||
xvt_fsys_build_pathname(path, NULL, exedir, "campo", "ini", NULL);
|
||||
if (! xvt_fsys_file_exists(path))
|
||||
{
|
||||
char msg[256];
|
||||
sprintf(msg, "Impossibile aprire '%s'", (const char *)path);
|
||||
xvt_dm_post_fatal_exit(msg);
|
||||
}
|
||||
#ifdef WIN32
|
||||
}
|
||||
#endif
|
||||
prawin = xvt_str_duplicate(path);
|
||||
}
|
||||
return prawin;
|
||||
return xvt_fsys_get_campo_ini();
|
||||
}
|
||||
|
||||
HIDDEN BOOLEAN CGetFirmDir()
|
||||
|
@ -2466,7 +2466,18 @@ TForm_item& TPrint_section::find_field(short id) const
|
||||
{
|
||||
TForm_item* f = exist_field(id);
|
||||
if (f) return *f;
|
||||
yesnofatal_box("Can't find item with id %d", id);
|
||||
|
||||
TString4 str;
|
||||
str << section_type();
|
||||
switch (page_type())
|
||||
{
|
||||
case first_page: str << 'F'; break;
|
||||
case even_page : str << 'E'; break;
|
||||
case last_page : str << 'L'; break;
|
||||
default : str << 'O'; break;
|
||||
}
|
||||
yesnofatal_box("Impossibile trovare il campo %d nella sezione %s del form %s",
|
||||
id, (const char*)str, (const char*)form().name());
|
||||
return field(0);
|
||||
}
|
||||
|
||||
|
@ -2083,14 +2083,16 @@ int TSystemisamfile::update(
|
||||
def = oldrec.fielddef(j);
|
||||
if (def.get(0)[0] == '_')
|
||||
{
|
||||
if (newfields < MaxFields)
|
||||
wrec.update_fielddef(++newfields, def);
|
||||
else
|
||||
if(!yesnofatal_box("Il campo %s non verra' preservato, devo continuare",
|
||||
(const char *) def.get(0)))
|
||||
return NOERR;
|
||||
if (newrec.field(def) == FIELDERR)
|
||||
{
|
||||
if (newfields < MaxFields)
|
||||
wrec.update_fielddef(++newfields, def);
|
||||
else
|
||||
if(!yesno_box("Il campo %s non verra' preservato, devo continuare",
|
||||
(const char *) def.get(0)))
|
||||
return NOERR;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (wfields < newfields)
|
||||
{
|
||||
|
@ -344,7 +344,7 @@ bool TMultiple_rectype::is_equal(const TMultiple_rectype& m) const
|
||||
int TMultiple_rectype::remove(TBaseisamfile & f) const
|
||||
{
|
||||
int err = NOERR;
|
||||
for (int i = _files.last(); err == NOERR && i >= 0 ; i = _files.pred(i))
|
||||
for (int i = _logicnums.last(); err == NOERR && i >= 0 ; i = _logicnums.pred(i))
|
||||
{
|
||||
TRecord_array & r = body(lognum(i));
|
||||
err = r.remove();
|
||||
|
@ -18,7 +18,6 @@ class TRecord_info;
|
||||
class TTrec;
|
||||
|
||||
typedef int TIsam_handle;
|
||||
typedef int TCodeb_handle;
|
||||
|
||||
class TFile_manager : public TObject
|
||||
{
|
||||
|
@ -1582,13 +1582,8 @@ const char* real::string(const char *picture) const
|
||||
// Certified 50%
|
||||
const char* real::format(const char *picture) const
|
||||
{
|
||||
if (*picture == '\0')
|
||||
return string ();
|
||||
|
||||
TString& f = get_tmp_string();
|
||||
dsprintf((char *)(const char *) f, (char *) picture, ptr());
|
||||
|
||||
return f;
|
||||
fatal_box("NOT IMPLEMENTED");
|
||||
return picture;
|
||||
}
|
||||
|
||||
// Certified 99%
|
||||
|
@ -66,6 +66,8 @@ public:
|
||||
const char* stringa(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
|
||||
// @cmember Ritorna la stringa con il formato passato
|
||||
const char* string(const char* picture) const;
|
||||
// @cmember Ritorna la stringa con il formato passato
|
||||
const char* format(const char *picture) const;
|
||||
|
||||
// @cmember Ritorna la precisione del reale (numero di decimali)
|
||||
int precision() const;
|
||||
@ -207,7 +209,7 @@ public:
|
||||
// @cmember Ritorna la stringa con il formato passato
|
||||
const char* string(const char* picture) const;
|
||||
// @cmember Ritorna la stringa con il formato passato
|
||||
const char* real::format(const char *picture) const;
|
||||
const char* format(const char *picture) const;
|
||||
|
||||
// @cmember Ritorna la precisione del reale (numero di decimali)
|
||||
int precision() const;
|
||||
|
@ -523,7 +523,10 @@ void TFile_cache::test_firm()
|
||||
{
|
||||
const clock_t next_test = _last_change_test + 10000;
|
||||
if (clock() > next_test)
|
||||
{
|
||||
flush_needed =_file->is_changed_since(_last_read);
|
||||
_last_change_test = clock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -544,7 +547,6 @@ void TFile_cache::test_firm()
|
||||
{
|
||||
flush();
|
||||
destroy();
|
||||
_last_change_test = clock();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,6 @@
|
||||
#define NOERR 0
|
||||
#define FIELDERR -1
|
||||
|
||||
typedef long TRecnotype;
|
||||
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
// @enum TFilelock | Comandi per l'apertura dei file
|
||||
@ -101,5 +98,8 @@ enum TIsamerr {
|
||||
_istrcerr = 227 // @emem Tracciato record incoerente
|
||||
};
|
||||
|
||||
typedef long TRecnotype;
|
||||
typedef int TCodeb_handle;
|
||||
|
||||
#endif // __RECTYPES_H
|
||||
|
||||
|
@ -1712,9 +1712,7 @@ bool TRelation_application::load_transaction()
|
||||
_mask->on_firm_change();
|
||||
else
|
||||
error_box("La ditta %ld non esiste", firm);
|
||||
|
||||
}
|
||||
|
||||
if (_curr_transaction == TRANSACTION_RUN)
|
||||
retv= FALSE; // Ho gia' finito qui: basta il cambio ditta
|
||||
else
|
||||
|
@ -288,7 +288,6 @@ void TRelation::print_on(ostream& out) const
|
||||
void TRelation::restore_status()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = _files.last(); i >= 0 ; i--)
|
||||
{
|
||||
const int err = _status.get_int(i*3);
|
||||
|
@ -110,7 +110,7 @@ long fsize(const char* name)
|
||||
// @flag FALSE | Se l'operazione non e' riuscita
|
||||
bool make_dir(const char* dir) // @parm Nome della directory da creare
|
||||
{
|
||||
return xvt_fsys_mkdir(dir);
|
||||
return xvt_fsys_mkdir(dir) != 0;
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ bool make_dir(const char* dir) // @parm Nome della directory da creare
|
||||
// @flag FALSE | Se l'operazione non e' riuscita
|
||||
bool remove_file(const char* file) // @parm Nome della directory da creare
|
||||
{
|
||||
return xvt_fsys_removefile(file);
|
||||
return xvt_fsys_removefile(file) != 0;
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
Loading…
x
Reference in New Issue
Block a user