applicat.cpp Tolti include inutili
codeb.c Sostituita la x4go con la d4go isam.cpp Tolta una riga vuota maskfld.cpp Aggiunto controllo sugli id duplicati relation.cpp Aggiunto test di cancellato nel metodo TCursor::changed realtion.h Aggiunto const al metodo TFieldref::len git-svn-id: svn://10.65.10.50/trunk@4027 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e99622f927
commit
12f4ee0441
@ -4,8 +4,6 @@
|
||||
#define XVT_INCL_NATIVE
|
||||
#include <xvt.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#include <toolhelp.h>
|
||||
#endif
|
||||
@ -13,17 +11,16 @@
|
||||
#include <applicat.h>
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
#include <controls.h>
|
||||
#include <extcdecl.h>
|
||||
#include <mask.h>
|
||||
#include <modaut.h>
|
||||
#include <prefix.h>
|
||||
#include <printer.h>
|
||||
#include <progind.h>
|
||||
#include <extcdecl.h>
|
||||
#include <modaut.h>
|
||||
#include <relation.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
#include <xvtility.h>
|
||||
#include <controls.h>
|
||||
|
||||
#include <bagn002.h>
|
||||
|
||||
|
@ -516,7 +516,6 @@ HIDDEN int cisread(isfdptr isfd, TRectype & record, int mode)
|
||||
HIDDEN int delkeys(isfdptr fd, char* record,long recno)
|
||||
{
|
||||
int rt=NOERR,oldkey = fd->knum;
|
||||
|
||||
|
||||
for (int i=1; i<=fd->r->NKeys;i++)
|
||||
{
|
||||
|
@ -267,12 +267,14 @@ void TMask_field::construct(TScanner& scanner, WINDOW parent)
|
||||
parse_head(scanner);
|
||||
|
||||
scanner.popkey(); // BEGIN
|
||||
#ifdef DBG
|
||||
#ifdef DBG
|
||||
if (scanner.key() != "BE")
|
||||
{
|
||||
yesnofatal_box("Testata errata o BEGIN mancante nel campo %d", _ctl_data._dlg);
|
||||
NFCHECK("Testata errata o BEGIN mancante nel campo %d", _ctl_data._dlg);
|
||||
scanner.push();
|
||||
}
|
||||
if (_ctl_data._dlg > 0 && mask().id2pos(_ctl_data._dlg) >= 0)
|
||||
NFCHECK("Esistono due campi con identificatore %d", _ctl_data._dlg);
|
||||
#endif
|
||||
|
||||
while(scanner.popkey() != "EN") // END of control
|
||||
|
@ -436,7 +436,7 @@ void TRelation::write_enable(
|
||||
// @syntax void write_enable(const char* name, const bool on)
|
||||
//
|
||||
// @comm Nel caso venga passato un numero logico uguale a 0 vengono abilitati/disabilitati tutti
|
||||
// i file dell relazione
|
||||
// i file della relazione
|
||||
|
||||
|
||||
{
|
||||
@ -881,10 +881,11 @@ bool TRelation::exist(int logicnum) const
|
||||
|
||||
HIDDEN bool __evalcondition(const TRelation& r,TExpression* cond)
|
||||
{
|
||||
TFieldref f;
|
||||
for (int i = cond->numvar() - 1; i >= 0; i--)
|
||||
{
|
||||
const char* s = cond->varname(i);
|
||||
TFieldref f(s,0);
|
||||
const TFixed_string s(cond->varname(i));
|
||||
f = s;
|
||||
cond->setvar(i, f.read(r));
|
||||
}
|
||||
return (bool) *cond;
|
||||
@ -1040,14 +1041,12 @@ bool TCursor::ok() const
|
||||
}
|
||||
|
||||
bool TCursor::changed()
|
||||
|
||||
{
|
||||
isdef* fh = file().filehnd();
|
||||
|
||||
if (_frozen && _lastrec > 0L) return _filename != fh->d->SysName;
|
||||
if (_frozen && _lastrec > 0L)
|
||||
return _filename != fh->d->SysName;
|
||||
|
||||
const TRecnotype eod = DB_reccount(fh->fhnd);
|
||||
|
||||
if (_lastrec != eod ||
|
||||
(_lastkrec != DB_changed(fh->fhnd)) ||
|
||||
(_filename != fh->d->SysName))
|
||||
@ -1057,7 +1056,11 @@ bool TCursor::changed()
|
||||
// _lastkrec = DB_changed(fh->fhnd);
|
||||
return TRUE;
|
||||
}
|
||||
else return FALSE;
|
||||
|
||||
if (!curr().valid())
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRecnotype TCursor::update()
|
||||
@ -1099,7 +1102,7 @@ void TCursor::filter(
|
||||
|
||||
if (file().tab())
|
||||
{
|
||||
TTable& f = (TTable&) file();
|
||||
const TTable& f = (const TTable&)file();
|
||||
kf = kto = f.name();
|
||||
}
|
||||
if (from != NULL)
|
||||
@ -1253,7 +1256,8 @@ TRecnotype TCursor::read(TIsamop op, TReclock lockop, TDate& atdate)
|
||||
|
||||
TCursor::TCursor(TRelation* r, const char* fil, int nkey,
|
||||
const TRectype *from, const TRectype* to)
|
||||
: _if(r), _nkey(nkey), _frozen(FALSE), _filterfunction(NULL), _fexpr(NULL), _filter_update(FALSE), _filterfunction_update(FALSE)
|
||||
: _if(r), _nkey(nkey), _frozen(FALSE), _filterfunction(NULL), _fexpr(NULL),
|
||||
_filter_update(FALSE), _filterfunction_update(FALSE)
|
||||
{
|
||||
file().setkey(_nkey);
|
||||
_pos = 0;
|
||||
@ -1275,7 +1279,6 @@ TCursor::~TCursor()
|
||||
|
||||
|
||||
TRecnotype TCursor::readrec()
|
||||
|
||||
{
|
||||
TRecnotype& nrec = file().filehnd()->RecNo;
|
||||
|
||||
@ -1362,8 +1365,12 @@ TRecnotype TCursor::items()
|
||||
bool TCursor::next_match(int lognum, const char* fl, int nk)
|
||||
{
|
||||
if (lognum == 0 || lognum == file().num())
|
||||
{++(*this); return file().good(); }
|
||||
else return _if->next_match(lognum, fl, nk);
|
||||
{
|
||||
++(*this);
|
||||
return file().good();
|
||||
}
|
||||
else
|
||||
return _if->next_match(lognum, fl, nk);
|
||||
}
|
||||
|
||||
bool TCursor::is_first_match(int ln)
|
||||
@ -1403,7 +1410,7 @@ bool TSorted_cursor::check_expr(
|
||||
int rt=TRUE;
|
||||
|
||||
if (p>-1 && p1>-1)
|
||||
if (s.find("UPPER") == -1)
|
||||
if (s.find("UPPER") < 0)
|
||||
{
|
||||
error_box("Only UPPER() operator is allowed");
|
||||
rt=FALSE;
|
||||
@ -1432,7 +1439,7 @@ bool TSorted_cursor::is_upper(TString& s)
|
||||
// Controlla se nell'espressione esiste l'operatore UPPER()
|
||||
{
|
||||
bool rt=TRUE;
|
||||
if (s.find("UPPER")>-1)
|
||||
if (s.find("UPPER") >= 0)
|
||||
rt=check_expr(s);
|
||||
else
|
||||
rt=FALSE;
|
||||
@ -1552,7 +1559,6 @@ TRecnotype TSorted_cursor::buildcursor(TRecnotype rp)
|
||||
|
||||
int TSorted_cursor::filtercursor(int pagecnt, TRecnotype* page)
|
||||
{
|
||||
|
||||
int np=0, handle=file().filehnd()->fhnd;
|
||||
TRectype& rec=file().curr();
|
||||
TString s;
|
||||
@ -1613,11 +1619,12 @@ bool TSorted_cursor::changed()
|
||||
rt = TCursor::changed();
|
||||
if (!rt) rt=_is_changed_expr;
|
||||
_is_changed_expr = FALSE;
|
||||
} else
|
||||
{
|
||||
error_box("Can't perform changed() while expression ain't valid!");
|
||||
rt=FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NFCHECK("Can't perform changed() while expression is not valid!");
|
||||
rt=FALSE;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
@ -1627,7 +1634,7 @@ void TSorted_cursor::change_order(const char* order_expr)
|
||||
if (order_expr && *order_expr && order_expr != _order_expr)
|
||||
{
|
||||
TString s;
|
||||
_order_expr = order_expr;
|
||||
_order_expr = order_expr;
|
||||
_order_expr.restart();
|
||||
while ((s=_order_expr.get()).not_empty() && (_is_valid_expr=check_expr(s))) ;
|
||||
if (_is_valid_expr)
|
||||
@ -1776,7 +1783,7 @@ void TFieldref::print_on(ostream& out) const
|
||||
|
||||
const char* TFieldref::read(const TRectype& rec) const
|
||||
{
|
||||
static TString256 buffer;
|
||||
static TString buffer;
|
||||
|
||||
if (_fileid >= CNF_GENERAL)
|
||||
{
|
||||
@ -1827,7 +1834,7 @@ void TFieldref::write(const char* val, TRectype& rec) const
|
||||
}
|
||||
}
|
||||
|
||||
int TFieldref::len(TRectype &rec) const
|
||||
int TFieldref::len(const TRectype &rec) const
|
||||
{
|
||||
if (_to >= 0)
|
||||
return _to - _from;
|
||||
|
@ -535,7 +535,7 @@ public:
|
||||
int to() const
|
||||
{ return _to; }
|
||||
// @cmember Ritorna la lunghezza del campo di <p TRectype>
|
||||
int len(TRectype &rec) const;
|
||||
int len(const TRectype &rec) const;
|
||||
// @cmember Cerca nella relazione il campo e ne ritorna il contenuto
|
||||
const char* read(const TRelation&) const;
|
||||
// @cmember Cerca nel record il campo e ne ritorna il contenuto
|
||||
|
Loading…
x
Reference in New Issue
Block a user