Patch level : 10.0
Files correlati : agalib.lib Ricompilazione Demo : [ ] Commento : Migliorato parsing dell'elenco delle patch in installazione da internet Aggiunta possibilita' di specificare il titolo delle maschere di riga git-svn-id: svn://10.65.10.50/trunk@17902 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e413ae8dc2
commit
5bd40db53b
@ -28,7 +28,7 @@ END
|
||||
|
||||
LIST F_TIPO 20
|
||||
BEGIN
|
||||
PROMPT 40 2 ""
|
||||
PROMPT 41 2 ""
|
||||
HELP "Tipo di dati da selezionare"
|
||||
ITEM "0|Ditte"
|
||||
MESSAGE ENABLE,1@
|
||||
|
102
include/codeb.c
102
include/codeb.c
@ -468,21 +468,25 @@ int DB_add(int handle)
|
||||
--------------------------------------------------------------------------*/
|
||||
int DB_lockfile(int handle)
|
||||
{
|
||||
int rt;
|
||||
|
||||
if(!handle_ok(handle)) return(-1);
|
||||
rt = d4lockFile(dbdata[handle]);
|
||||
if (rt==0) rt=d4lockIndex(dbdata[handle]);
|
||||
return(rt);
|
||||
int rt = -1;
|
||||
if(handle_ok(handle))
|
||||
{
|
||||
rt = d4lockFile(dbdata[handle]);
|
||||
if (rt==0)
|
||||
rt=d4lockIndex(dbdata[handle]);
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
HIDDEN void do_key(const char *fname, const RecDes* r, TAG4INFO* tag_info, int n_keys)
|
||||
HIDDEN void do_key(const char* fname, const RecDes* r, TAG4INFO* tag_info, int ntags)
|
||||
{
|
||||
const int nkeys = min(r->NKeys, ntags);
|
||||
int i,j;
|
||||
char tiname[_MAX_FNAME]; /* Tag name */
|
||||
xvt_fsys_parse_pathname(fname, NULL, NULL, tiname, NULL, NULL);
|
||||
xvt_str_make_upper(tiname);
|
||||
for (i=0; ((i < MaxKeys) && (i < n_keys)); i++)
|
||||
|
||||
for (i=0; i < nkeys; i++)
|
||||
{
|
||||
tag_info[i].name=(char *)u4alloc(_MAX_FNAME);
|
||||
tag_info[i].expression=(char *)u4alloc(256);
|
||||
@ -545,12 +549,12 @@ HIDDEN void do_key(const char *fname, const RecDes* r, TAG4INFO* tag_info, int n
|
||||
strcat((char *)tag_info[i].expression,",0)");
|
||||
}
|
||||
break;
|
||||
case _boolfld:
|
||||
strcat((char *)tag_info[i].expression,",\"T\",\"F\")");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case _boolfld:
|
||||
strcat((char *)tag_info[i].expression,",\"T\",\"F\")");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Close parentheses if UPPER or DTOS operators were used: */
|
||||
if (r->Ky[i].FieldSeq[j] > MaxFields || (r->Fd[nf].TypeF == _datefld))
|
||||
@ -582,7 +586,7 @@ HIDDEN void do_key(const char *fname, const RecDes* r, TAG4INFO* tag_info, int n
|
||||
/*-------------------------------------------------------------------------
|
||||
Compatta il file dati
|
||||
--------------------------------------------------------------------------*/
|
||||
int DB_packfile(short vis, const char * filename, long eod)
|
||||
int DB_packfile(short vis, const char* filename, long eod)
|
||||
{
|
||||
int rt=0,handle;
|
||||
|
||||
@ -645,7 +649,8 @@ int DB_packmemo(short vis, const char * filename)
|
||||
/*-------------------------------------------------------------------------
|
||||
Elimina i record duplicati
|
||||
--------------------------------------------------------------------------*/
|
||||
static int DB_clean_file(int handle, const char* filename, const RecDes* r, short vis)
|
||||
static int DB_clean_file(int handle, const char* filename,
|
||||
const char* tagname, const RecDes* r, short vis)
|
||||
{
|
||||
TAG4INFO tags[2];
|
||||
TAG4 * t;
|
||||
@ -659,7 +664,8 @@ static int DB_clean_file(int handle, const char* filename, const RecDes* r, shor
|
||||
return 0;
|
||||
|
||||
s[0] = '\0';
|
||||
do_key(filename, r, tags, 1);
|
||||
memset(tags, 0, sizeof(tags));
|
||||
do_key(tagname, r, tags, 1);
|
||||
strcat((char *) tags[0].expression, "+STR(RECNO(),9)");
|
||||
w = i4create(dbdata[handle],(char*)filename,tags);
|
||||
u4free((char *) tags[0].name);
|
||||
@ -704,18 +710,15 @@ static int DB_clean_file(int handle, const char* filename, const RecDes* r, shor
|
||||
Compatta gli indici
|
||||
--------------------------------------------------------------------------*/
|
||||
|
||||
int DB_yesnobox(const char* msg)
|
||||
static int DB_yesnobox(const char* msg)
|
||||
{
|
||||
return xvt_dm_post_ask("Si", "No", NULL, msg) == RESP_DEFAULT;
|
||||
}
|
||||
|
||||
int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool ask)
|
||||
int DB_packindex(short vis, const char* filename, const RecDes *r, long *peod, bool ask)
|
||||
{
|
||||
int rt=0,handle;
|
||||
TAG4INFO tags[MaxKeys+1];
|
||||
int handle = 0, rt = 0;
|
||||
char s[256];
|
||||
INDEX4 * w = NULL;
|
||||
|
||||
strcpy(s,"Ricostruzione indici file : ");
|
||||
strcat(s,filename);
|
||||
|
||||
@ -723,11 +726,19 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
|
||||
handle=DB_open(filename,1,0); /* Exclusive mode open */
|
||||
if (handle >= 0)
|
||||
{
|
||||
int i;
|
||||
TAG4INFO tags[MaxKeys+1];
|
||||
INDEX4 * w = NULL;
|
||||
int i = 0;
|
||||
const char *ff = find_slash_backslash(filename);
|
||||
if (vis)
|
||||
progind_create(1,s,0,1,60);
|
||||
if ((ff == NULL) || *ff == '\0')
|
||||
ff = (const char*)filename;
|
||||
else
|
||||
ff++;
|
||||
memset(tags, 0, sizeof(tags));
|
||||
do_key(ff, r, tags, r->NKeys);
|
||||
|
||||
do_key(filename, r,tags, r->NKeys);
|
||||
w = i4create(dbdata[handle],NULL,tags);
|
||||
|
||||
if (vis)
|
||||
@ -739,14 +750,14 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
|
||||
{
|
||||
rt = 0;
|
||||
if (!ask || DB_yesnobox("Sono stati rilevati alcuni records duplicati:\nsi desidera eliminarli?"))
|
||||
rt = DB_clean_file(handle, filename, r, vis);
|
||||
rt = DB_clean_file(handle, filename, ff, r, vis);
|
||||
else
|
||||
tags[0].unique = r4unique_continue;
|
||||
if (rt == 0)
|
||||
{
|
||||
if (vis)
|
||||
progind_create((long)r->NKeys,s,0,1,60);
|
||||
w = i4create(dbdata[handle],(char*)filename,tags);
|
||||
w = i4create(dbdata[handle],filename,tags);
|
||||
if (w == NULL) rt = code_base.errorCode;
|
||||
if (vis)
|
||||
{
|
||||
@ -755,26 +766,7 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rt == 0)
|
||||
{
|
||||
if (u4switch() & 2 || u4switch() & 8) /* Clipper and DBIII */
|
||||
{
|
||||
FILE *fp;
|
||||
char cgp[81];
|
||||
|
||||
strcpy(cgp,filename);
|
||||
strcat(cgp,".cgp");
|
||||
if ((fp=fopen(cgp,"w"))!=NULL)
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j=0; j<r->NKeys;j++)
|
||||
fprintf(fp,"%s\n",tags[j].name);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i=0; ((i < MaxKeys) && (i < r->NKeys)); i++)
|
||||
for (i=0; i < r->NKeys && tags[i].name; i++)
|
||||
{
|
||||
u4free((char *) tags[i].name);
|
||||
u4free((char *) tags[i].expression);
|
||||
@ -784,6 +776,17 @@ int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool a
|
||||
DB_close(handle);
|
||||
}
|
||||
code_base.autoOpen = 1;
|
||||
|
||||
#ifdef DBG
|
||||
strcpy(s, filename);
|
||||
strcat(s, ".cdx");
|
||||
if (xvt_fsys_file_attr(s, XVT_FILE_ATTR_SIZE) == 0)
|
||||
{
|
||||
strcat(s, " e' appena stato sputtanato!");
|
||||
xvt_dm_post_error(s);
|
||||
}
|
||||
#endif
|
||||
|
||||
return(rt);
|
||||
}
|
||||
|
||||
@ -845,14 +848,15 @@ int DB_build(const char* filename, const RecDes* r)
|
||||
ff = filename;
|
||||
else
|
||||
ff++;
|
||||
do_key(ff,r,tag_info, r->NKeys);
|
||||
|
||||
do_key(ff,r,tag_info, MaxKeys);
|
||||
|
||||
if ((dbuilded=d4create(&code_base, (char *)filename, field_info, tag_info))==0) /* deve solo creare il file dati vuoto */
|
||||
rt=code_base.errorCode;
|
||||
else
|
||||
rt=d4close(dbuilded);
|
||||
|
||||
/* Non abbiamo mai usato e spariamo mai useremo questo genere di files!!!!
|
||||
/* Non abbiamo mai usato e speriamo mai useremo questo genere di files!!!!
|
||||
if (u4switch() & 2 || u4switch() & 8) //Rebuild filename.cgp for CLIPPER AND DBIII only
|
||||
{
|
||||
FILE* fp;
|
||||
|
@ -48,7 +48,7 @@ extern "C" {
|
||||
int DB_lockfile(int handle); /* Per sbloccare il record basta la DB_unlock()*/
|
||||
int DB_packfile(short vis, const char * filename, long eod);
|
||||
int DB_packmemo(short vis, const char * filename);
|
||||
int DB_packindex(short vis, const char * filename, RecDes *r, long *peod, bool ask );
|
||||
int DB_packindex(short vis, const char * filename, const RecDes *r, long *peod, bool ask );
|
||||
int DB_build(const char * filename, const RecDes *r);
|
||||
int DB_recinfo(const char * filename, FileDes *d, RecDes *r, char* keys);
|
||||
int DB_get_error(void);
|
||||
|
@ -355,10 +355,10 @@ int TDir::items (
|
||||
return (int) f.EOD;
|
||||
}
|
||||
|
||||
TTrec::TTrec (int logicnum) : _des(NULL), _num(-1)
|
||||
TTrec::TTrec (int logicnum, TDirtype dirtype) : _des(NULL), _num(-1)
|
||||
{
|
||||
zero();
|
||||
get(logicnum);
|
||||
get(logicnum, dirtype);
|
||||
}
|
||||
|
||||
|
||||
|
@ -261,7 +261,7 @@ public:
|
||||
// @cmember Costruttore
|
||||
TTrec(const TTrec & r);
|
||||
// @cmember Costruttore
|
||||
TTrec(int logicnum);
|
||||
TTrec(int logicnum, TDirtype dirtype = _nordir);
|
||||
TTrec();
|
||||
// @cmember Distruttore
|
||||
virtual ~TTrec();
|
||||
|
@ -2022,9 +2022,7 @@ int TSystemisamfile::update(
|
||||
const bool is_com = prefix().is_com();
|
||||
const bool toconvert = is_com ? dir.is_com() : dir.is_firm();
|
||||
|
||||
TTrec oldrec;
|
||||
oldrec.get(num());
|
||||
|
||||
TTrec oldrec(num(), is_com ? _comdir : _nordir);
|
||||
if (oldrec.fields() < 0 || oldrec.fields() > MaxFields)
|
||||
{
|
||||
if (yesno_box(FR("Il file %d (%s)\n"
|
||||
@ -2337,10 +2335,11 @@ int TSystemisamfile::packindex(
|
||||
// @xref <mf TSystemisamfile::packfile>
|
||||
|
||||
{
|
||||
TTrec r; r.get(num());
|
||||
const TTrec r(num());
|
||||
TDir d(num());
|
||||
const bool is_com = d.is_com();
|
||||
//d.get(num(),_nolock, is_com ? _comdir : _nordir, _sysdirop);
|
||||
d.get(num(),_nolock, is_com ? _comdir : _nordir, _sysdirop);
|
||||
|
||||
TFilename name = d.filename(); name.ext("");
|
||||
TRecnotype peod;
|
||||
int err=DB_packindex(vis,name,&r.rec(),&peod,ask);
|
||||
@ -2861,26 +2860,26 @@ int TSystemisamfile::dump(
|
||||
TString s(512);
|
||||
bool fixedlen = (fs == '\0');
|
||||
int nflds = curr().items();
|
||||
TArray fld(nflds);
|
||||
TString_array fld(nflds);
|
||||
TBit_array rjust(nflds);
|
||||
int len[MaxFields];
|
||||
int j;
|
||||
|
||||
for (j = 0; j < nflds; j++)
|
||||
{
|
||||
fld.add(TString(curr().fieldname(j)), j);
|
||||
const TString & wfld = (const TString&) fld[j];
|
||||
fld.add(curr().fieldname(j), j);
|
||||
const TString & wfld = fld.row(j);
|
||||
const TFieldtypes t = curr().type(wfld);
|
||||
rjust.set(j, t == _intfld || t == _longfld || t == _realfld ||
|
||||
t == _wordfld || t == _intzerofld || t == _longzerofld);
|
||||
len[j] = (t == _datefld) ? 10 : curr().length(wfld);
|
||||
if (fixedlen && t == _memofld)
|
||||
return error_box("Non e' possibile scaricare a lunghezza fissa un file con campi memo");
|
||||
return error_box(TR("Non e' possibile scaricare a lunghezza fissa un file con campi memo"));
|
||||
}
|
||||
TRecnotype i = 0;
|
||||
const TRecnotype nitems = items();
|
||||
|
||||
s.format("Esportazione archivio %s", filename());
|
||||
s.format(FR("Esportazione archivio %s"), filename());
|
||||
TProgind p(nitems, s, TRUE, TRUE, 70);
|
||||
TString s1, sfld;
|
||||
|
||||
@ -2914,35 +2913,61 @@ int TSystemisamfile::dump(
|
||||
if (skip)
|
||||
continue;
|
||||
}
|
||||
s = "";
|
||||
s.cut(0);
|
||||
for (j = 0; j < nflds; j++)
|
||||
{
|
||||
const TString& fname = fld.row(j);
|
||||
if (fixedlen)
|
||||
{
|
||||
s1 = get((const TString&)fld[j]);
|
||||
s1 = get(fname);
|
||||
if (rjust[j]) s1.right_just(len[j]);
|
||||
else s1.left_just(len[j]);
|
||||
}
|
||||
else
|
||||
{
|
||||
s1 = "";
|
||||
s1.cut(0);
|
||||
if (j && fs) s1 << fs;
|
||||
if (fd) s1 << fd;
|
||||
sfld = get((const TString&)fld[j]);
|
||||
if (curr().type((const TString&) fld[j]) == _memofld)
|
||||
sfld = get(fname);
|
||||
switch (curr().type(fname))
|
||||
{
|
||||
int p = 0;
|
||||
while ((p = sfld.find('\n', 0)) >= 0)
|
||||
case _intfld:
|
||||
case _longfld:
|
||||
case _intzerofld:
|
||||
case _longzerofld:
|
||||
case _realfld:
|
||||
if (real::is_null(sfld))
|
||||
sfld.cut(0);
|
||||
break;
|
||||
case _memofld:
|
||||
if (sfld.full())
|
||||
{
|
||||
sfld.overwrite("\\", p);
|
||||
sfld.insert("n", p+1);
|
||||
int p = 0;
|
||||
while ((p = sfld.find('\n', 0)) >= 0)
|
||||
{
|
||||
sfld.overwrite("\\", p);
|
||||
sfld.insert("n", p+1);
|
||||
}
|
||||
}
|
||||
else
|
||||
sfld.cut(0);
|
||||
break;
|
||||
default: // strfld, charfld, boolfld
|
||||
if (sfld.blank())
|
||||
sfld.cut(0);
|
||||
break;
|
||||
}
|
||||
s1 << sfld;
|
||||
if (fd) s1 << fd;
|
||||
}
|
||||
s << s1;
|
||||
}
|
||||
if (fs) // Elimina tutti i campi vuoti a fine record
|
||||
{
|
||||
int i;
|
||||
for (i = s.len()-1; i >= 0 && s[i] == fs; i--);
|
||||
s.cut(i+1);
|
||||
}
|
||||
fprintf(f, "%s%c", (const char*) s, rs);
|
||||
}
|
||||
}
|
||||
@ -3057,12 +3082,12 @@ int TSystemisamfile::dump(
|
||||
t == _wordfld || t == _intzerofld || t == _longzerofld);
|
||||
len[j++] = (t == _datefld) ? 10 : curr().length(fldname);
|
||||
if (fixedlen && t == _memofld)
|
||||
return error_box("Non e' possibile scaricare a lunghezza fissa un file con campi memo");
|
||||
return error_box(TR("Non e' possibile scaricare a lunghezza fissa un file con campi memo"));
|
||||
}
|
||||
TRecnotype i = 0;
|
||||
const TRecnotype nitems = items();
|
||||
|
||||
s.format("Esportazione archivio %s", filename());
|
||||
s.format(FR("Esportazione archivio %s"), filename());
|
||||
TProgind p(nitems, s, TRUE, TRUE, 70);
|
||||
TString s1, sfld;
|
||||
|
||||
|
@ -1,11 +1,6 @@
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
#include <isamrpc.h>
|
||||
|
||||
#include <netsock.h>
|
||||
|
||||
static TSocketClient* _client = NULL;
|
||||
@ -63,16 +58,16 @@ static TString _rpc_string;
|
||||
inline bool BoolCall()
|
||||
{
|
||||
CHECK(_connection, "Server not connected");
|
||||
bool yes;
|
||||
bool yes = false;
|
||||
bool ok = _client->RequestBool(_connection, _rpc_call, yes) != 0;
|
||||
if (!ok)
|
||||
{
|
||||
#ifndef DBG
|
||||
yesnofatal_box("RPC call failed: %s", (const char*)_rpc_call);
|
||||
#endif
|
||||
yes = FALSE;
|
||||
yes = false;
|
||||
}
|
||||
return yes ? TRUE : FALSE;
|
||||
return yes;
|
||||
}
|
||||
|
||||
inline long IntCall()
|
||||
@ -128,7 +123,6 @@ inline long IntCallIntIntInt(const char* fn, long n, long k, long f)
|
||||
return IntCall();
|
||||
}
|
||||
|
||||
|
||||
inline long IntCallIntIntStr(const char* fn, long n, long k, const char* str)
|
||||
{
|
||||
_rpc_call.format("%s(%ld,%ld,|%s|)", fn, n, k, str);
|
||||
@ -159,7 +153,6 @@ inline long IntCallStr(const char* fn, const char* str)
|
||||
return IntCall();
|
||||
}
|
||||
|
||||
|
||||
inline TString& StrCallIntInt(const char* fn, long n, long k)
|
||||
{
|
||||
_rpc_call.format("%s(%ld,%ld)", fn, n, k);
|
||||
@ -318,9 +311,9 @@ bool rpc_UserLogout(const char* appname)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool http_isredirected_server(TString & server,
|
||||
TFilename & remote_file,
|
||||
const char * authorization)
|
||||
bool http_isredirected_server(TString& server,
|
||||
TFilename& remote_file,
|
||||
const char* authorization)
|
||||
{
|
||||
TSocketClient client;
|
||||
if (!client.IsOk())
|
||||
@ -331,14 +324,12 @@ bool http_isredirected_server(TString & server,
|
||||
if (ok)
|
||||
{
|
||||
ok = client.HttpIsRedirectedServer(connection, server, remote_file, authorization) != 0;
|
||||
|
||||
client.RemoveConnection(connection);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool http_get(const char* server,
|
||||
const char* remote_file,
|
||||
const char* local_file,
|
||||
@ -353,9 +344,7 @@ bool http_get(const char* server,
|
||||
if (ok)
|
||||
{
|
||||
ok = client.HttpGetFile(connection, remote_file, local_file, authorization) != 0;
|
||||
|
||||
client.RemoveConnection(connection);
|
||||
|
||||
}
|
||||
|
||||
return ok;
|
||||
@ -373,7 +362,6 @@ bool http_dir(const char* server, const char* remote_dir, TString_array& list)
|
||||
{
|
||||
ok = client.HttpGetDir(connection, remote_dir, list) != 0;
|
||||
client.RemoveConnection(connection);
|
||||
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
@ -1466,10 +1466,8 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
if (! refused)
|
||||
{
|
||||
const int col = _cur_col;
|
||||
XI_OBJ row;
|
||||
|
||||
_cur_col = -1;
|
||||
XI_MAKE_ROW(&row, _obj, _cur_row);
|
||||
XI_OBJ row; XI_MAKE_ROW(&row, _obj, _cur_row);
|
||||
xi_cell_request(&row); // Update internal values
|
||||
_cur_col = col;
|
||||
}
|
||||
@ -1506,7 +1504,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
||||
{
|
||||
const clock_t delay = clock() - digit_timer;
|
||||
if (delay <= 60)
|
||||
k = K_CTRL + '+'; // imedisce ulteiori elaborazioni
|
||||
k = K_CTRL + '+'; // impedisce ulteriori elaborazioni
|
||||
}
|
||||
}
|
||||
|
||||
@ -3174,13 +3172,26 @@ void TSheet_field::row2mask(int n, TToken_string& r, int mode)
|
||||
f.set_dirty(FALSE);
|
||||
}
|
||||
|
||||
val = TR("Riga"); val << ' ' << (n+1);
|
||||
m.set_caption(val);
|
||||
// Imposta titolo se pagina singola
|
||||
if (m.page_win(1) == NULL_WIN) // Non esiste pagina 2?
|
||||
{
|
||||
TString caption; m.get_caption(caption);
|
||||
if (caption.full())
|
||||
{
|
||||
const int spc = caption.find(" [");
|
||||
if (spc > 0)
|
||||
caption.cut(spc);
|
||||
}
|
||||
else
|
||||
caption = TR("Riga");
|
||||
caption << " [" << (n+1) << ']';
|
||||
m.set_caption(caption);
|
||||
}
|
||||
}
|
||||
|
||||
KEY TSheet_field::run_editmask(int )
|
||||
KEY TSheet_field::run_editmask(int n)
|
||||
{
|
||||
TMask& m = sheet_mask();
|
||||
TMask& m = sheet_row_mask(n);
|
||||
return m.run();
|
||||
}
|
||||
|
||||
@ -3236,11 +3247,11 @@ void TSheet_field::set_lines_record(TRecord_array & r_a)
|
||||
if (_linee_rec && !_external_record)
|
||||
delete _linee_rec;
|
||||
_linee_rec= & r_a;
|
||||
_external_record=TRUE; // il record attuale è esterno...
|
||||
_external_record = true; // il record attuale è esterno...
|
||||
}
|
||||
|
||||
// Certified: ...under debug..
|
||||
TRectype * TSheet_field::putkey(const TRelation& r)
|
||||
TRectype* TSheet_field::putkey(const TRelation& r)
|
||||
{
|
||||
if (_sheetfile)
|
||||
{
|
||||
|
@ -912,13 +912,27 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
|
||||
return ok;
|
||||
}
|
||||
|
||||
HIDDEN int find_href(const TString& riga, int from)
|
||||
HIDDEN int find_href(const TString& riga, int from, TString& filename)
|
||||
{
|
||||
int href = -1;
|
||||
int img = riga.find("<img", from);
|
||||
if (img >= 0)
|
||||
href = riga.find("href=", img+4);
|
||||
return href;
|
||||
while (from >= 0)
|
||||
{
|
||||
int href = riga.find("<a href=\"", from);
|
||||
if (href >= 0)
|
||||
{
|
||||
href += 9;
|
||||
const int quotes = riga.find("\">", href);
|
||||
filename = riga.sub(href, quotes);
|
||||
from = quotes+2;
|
||||
if (filename.match("*.*"))
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
from = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return from;
|
||||
}
|
||||
|
||||
bool TSocketClient::HttpGetDir(CONNID id, const char* remote, TString_array& list)
|
||||
@ -927,29 +941,18 @@ bool TSocketClient::HttpGetDir(CONNID id, const char* remote, TString_array& lis
|
||||
const bool ok = HttpGetFile(id, remote, local);
|
||||
if (ok)
|
||||
{
|
||||
ifstream s(local);
|
||||
TString riga(512);
|
||||
TFilename name;
|
||||
ifstream s(local);
|
||||
while (!s.eof())
|
||||
{
|
||||
s.getline(riga.get_buffer(), riga.size());
|
||||
riga.lower();
|
||||
for (int href = find_href(riga, 0); href > 0; href = find_href(riga, href+5))
|
||||
{
|
||||
const int start = riga.find('"', href) + 1;
|
||||
if (start > href)
|
||||
{
|
||||
const int stop = riga.find('"', start);
|
||||
if (stop > start)
|
||||
{
|
||||
const TString& name = riga.sub(start, stop);
|
||||
if (isdigit(name[0]) || (name[0]>='a' && name[0]<='z')) // isalnum non funziona!
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int href = find_href(riga, 0, name); href >= 0; href = find_href(riga, href, name))
|
||||
list.add(name);
|
||||
}
|
||||
s.close();
|
||||
::remove(local);
|
||||
xvt_fsys_remove_file(local);
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
@ -439,7 +439,7 @@ int TFile_info::close()
|
||||
if (_locked || _exclusive || dir_type() == _extdir)
|
||||
err = close_low();
|
||||
}
|
||||
_locked = _exclusive = FALSE;
|
||||
_locked = _exclusive = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -486,7 +486,7 @@ const TFilename& TFile_info::load_filedes()
|
||||
{
|
||||
memset(&_filedes, 0, sizeof(_filedes));
|
||||
CGetFile(num(), &_filedes, _nolock, _nordir);
|
||||
if (_filedes.SysName[0])
|
||||
if (_filedes.SysName[0] > ' ')
|
||||
{
|
||||
if (_filedes.SysName[0] != '$')
|
||||
_dir = _comdir;
|
||||
@ -1142,7 +1142,7 @@ bool TPrefix::set_codditta(long codditta, bool force)
|
||||
_firm->read(codditta);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* TPrefix::get_studio() const
|
||||
@ -1384,6 +1384,30 @@ bool TPrefix::build_firm_data(long codditta, bool flagcom)
|
||||
return true;
|
||||
}
|
||||
|
||||
int TPrefix::firms(TString_array& codes) const
|
||||
{
|
||||
codes.destroy();
|
||||
TFilename n = __ptprf; n.add("?????A");
|
||||
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, n, true);
|
||||
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
||||
{
|
||||
n = xvt_slist_get(dirs, e, NULL);
|
||||
const TString& code = n.name_only();
|
||||
if (exist(atol(code)))
|
||||
codes.add(code);
|
||||
}
|
||||
xvt_slist_destroy(dirs);
|
||||
return codes.items();
|
||||
}
|
||||
|
||||
int TPrefix::firms(TPointer_array& codes) const
|
||||
{
|
||||
TString_array strcodes; firms(strcodes);
|
||||
FOR_EACH_ARRAY_ROW(strcodes, t, row)
|
||||
codes.add_long(atol(*row));
|
||||
return codes.items();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TTable name converter
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -220,6 +220,8 @@ public:
|
||||
{ _manager.destroy_info(logicnum); }
|
||||
|
||||
const TFirm& firm();
|
||||
int firms(TString_array& codes) const;
|
||||
int firms(TPointer_array& codes) const; // calls above method!
|
||||
|
||||
// @cmember Costruttore
|
||||
TPrefix();
|
||||
|
@ -1026,7 +1026,7 @@ TSheet::TSheet(short x, short y, short dx, short dy,
|
||||
|
||||
if (buttons & 0x01) add_button(DLG_LINK, TR("Colle~ga"), K_CTRL+'G', BMP_LINK);
|
||||
if (buttons & 0x02) add_button(DLG_NEWREC, TR("~Nuovo"), K_INS, BMP_NEWREC);
|
||||
if (buttons & 0x04) add_button(DLG_DELREC, "~Elimina", K_DEL, BMP_DELREC);
|
||||
if (buttons & 0x04) add_button(DLG_DELREC, TR("~Elimina"), K_DEL, BMP_DELREC);
|
||||
|
||||
add_button(DLG_SAVEREC, TR("~Esporta"), 0, TOOL_EXPORT);
|
||||
set_handler(DLG_SAVEREC, export_handler);
|
||||
|
@ -264,4 +264,9 @@ public:
|
||||
virtual KEY run();
|
||||
};
|
||||
|
||||
#define FOR_EACH_CHECKED_ROW(__sheet, __r, __riga) \
|
||||
TToken_string* __riga = NULL; if ((__sheet).one_checked()) \
|
||||
for(long __r=0; __r < (__sheet).items() && (__riga = &(__sheet).row(__r))->not_empty(); __r++) \
|
||||
if ((__sheet).checked(__r))
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user