-corretta determinazione della lunghezza del campo "Tipo record"
-protetti i metodi autoload & auitosave su _current con un CHECK -default file == main file della relazione sui Fieldref git-svn-id: svn://10.65.10.50/trunk@5488 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b54e001da6
commit
b08a45ee83
@ -235,10 +235,14 @@ void TFile_text::set_rec_parm(TConfig& config, const char* section)
|
|||||||
}
|
}
|
||||||
if (lavoro == "FIE")
|
if (lavoro == "FIE")
|
||||||
{
|
{
|
||||||
TFieldref field;
|
TFieldref field;
|
||||||
field = obj;
|
field = obj;
|
||||||
tc.set_field(field);
|
if (field.file()==0 && tmprel )
|
||||||
continue;
|
{
|
||||||
|
field.set_file(tmprel->lfile().num());
|
||||||
|
}
|
||||||
|
tc.set_field(field);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (lavoro == "FTY") // field type
|
if (lavoro == "FTY") // field type
|
||||||
{
|
{
|
||||||
@ -259,8 +263,6 @@ void TFile_text::set_rec_parm(TConfig& config, const char* section)
|
|||||||
int len = atoi(obj);
|
int len = atoi(obj);
|
||||||
if (tc.length() <= 0 && len >= 0 && tc.length() != len)
|
if (tc.length() <= 0 && len >= 0 && tc.length() != len)
|
||||||
tc.set_length(len);
|
tc.set_length(len);
|
||||||
if (_fixedlen && _typelen < 0 && n == _typefield)
|
|
||||||
_typelen = len;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (lavoro == "DEC")
|
if (lavoro == "DEC")
|
||||||
@ -303,6 +305,9 @@ void TFile_text::set_rec_parm(TConfig& config, const char* section)
|
|||||||
tc.set_message(obj);
|
tc.set_message(obj);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (_fixedlen && _typelen < 0 && n == _typefield)
|
||||||
|
_typelen = tc.length();
|
||||||
|
|
||||||
}
|
}
|
||||||
tr->set_relation(tmprel);
|
tr->set_relation(tmprel);
|
||||||
//aggiungo il tracciato record all'assoc_array dei tracciati record
|
//aggiungo il tracciato record all'assoc_array dei tracciati record
|
||||||
@ -497,6 +502,12 @@ void TFile_text::autoload(TRecord_text& rec, TCursor& cur , const TString* tipo)
|
|||||||
_autoload(rec,cur,tr);
|
_autoload(rec,cur,tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TFile_text::autoload(TCursor& cur, const TString* tipo)
|
||||||
|
{
|
||||||
|
CHECK(_current,"Record corrente non settato");
|
||||||
|
autoload(*_current, cur, tipo);
|
||||||
|
}
|
||||||
|
|
||||||
//Carica tutti i dati nel tracciato record (valido anche per header e footer) nel record_text
|
//Carica tutti i dati nel tracciato record (valido anche per header e footer) nel record_text
|
||||||
void TFile_text::_autoload(TRecord_text& rec, TCursor& cur , TTracciato_record& tr )
|
void TFile_text::_autoload(TRecord_text& rec, TCursor& cur , TTracciato_record& tr )
|
||||||
{
|
{
|
||||||
@ -541,6 +552,12 @@ int TFile_text::autosave(TRelation& rel, const TRecord_text& rec)
|
|||||||
return _autosave(rel,rec, tr);
|
return _autosave(rel,rec, tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TFile_text::autosave(int mainfile)
|
||||||
|
{
|
||||||
|
CHECK(_current,"Record corrente non settato");
|
||||||
|
return autosave(mainfile,*_current);
|
||||||
|
}
|
||||||
|
|
||||||
//Carico la relazione con i dati del record text
|
//Carico la relazione con i dati del record text
|
||||||
int TFile_text::_autosave(TRelation& rel, const TRecord_text& rec, TTracciato_record& tr )
|
int TFile_text::_autosave(TRelation& rel, const TRecord_text& rec, TTracciato_record& tr )
|
||||||
{
|
{
|
||||||
@ -701,7 +718,7 @@ TString& TFile_text::format_textfield(const TTracciato_campo& tc, TString& campo
|
|||||||
//Formatta la stringa in base al field del file isam
|
//Formatta la stringa in base al field del file isam
|
||||||
TString& TFile_text::format_field(const TTracciato_campo& tc, TString& campo)
|
TString& TFile_text::format_field(const TTracciato_campo& tc, TString& campo)
|
||||||
{
|
{
|
||||||
const TRectype record(tc.field().file());
|
const TRectype record(tc.field().file());
|
||||||
|
|
||||||
int length = tc.field().len(record);
|
int length = tc.field().len(record);
|
||||||
if (!fpicture(tc).blank())
|
if (!fpicture(tc).blank())
|
||||||
@ -751,7 +768,7 @@ int TFile_text::open(char mode)
|
|||||||
|
|
||||||
int TFile_text::open(const char* name, char mode)
|
int TFile_text::open(const char* name, char mode)
|
||||||
{
|
{
|
||||||
set_name(name);
|
set_name(name);
|
||||||
return open(mode);
|
return open(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user