Corretti i filler
Corretto l'uso della lunghezza del campo Corretto bug di autosave git-svn-id: svn://10.65.10.50/trunk@5364 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
327cac43fb
commit
25a5d5d8bc
@ -283,8 +283,13 @@ void TFile_text::set_rec_parm(TConfig& config, const char* section)
|
|||||||
{
|
{
|
||||||
bool condition = tc.filler() != obj[1];
|
bool condition = tc.filler() != obj[1];
|
||||||
if (condition)
|
if (condition)
|
||||||
|
{
|
||||||
|
if (obj.len() > 1)
|
||||||
|
tc.set_filler(obj[1]);
|
||||||
|
else
|
||||||
tc.set_filler(obj[0]);
|
tc.set_filler(obj[0]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (lavoro == "PIC")
|
if (lavoro == "PIC")
|
||||||
@ -429,6 +434,8 @@ int TFile_text::write(TRecord_text& rec)
|
|||||||
TTracciato_record& tr = *t_rec(type);
|
TTracciato_record& tr = *t_rec(type);
|
||||||
TArray& a_tc = tr.tracciati_campo();
|
TArray& a_tc = tr.tracciati_campo();
|
||||||
int items = rec.items();
|
int items = rec.items();
|
||||||
|
if (_typepos>=0)
|
||||||
|
rec.add(type,_typepos);
|
||||||
if (_fixedlen) // campi a lunghezza fissa
|
if (_fixedlen) // campi a lunghezza fissa
|
||||||
{
|
{
|
||||||
for (int i = 0; i < items; i++)
|
for (int i = 0; i < items; i++)
|
||||||
@ -467,7 +474,8 @@ int TFile_text::write(TRecord_text& rec)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Carica tutti i dati nel tracciato record (valido anche per header e footer) nel record_text
|
// Carica tutti i dati del tracciato record (anche header o footer)
|
||||||
|
// nel record_text
|
||||||
void TFile_text::autoload(TRecord_text& rec, int mainfile)
|
void TFile_text::autoload(TRecord_text& rec, int mainfile)
|
||||||
{
|
{
|
||||||
TTracciato_record* tr = t_rec(mainfile);
|
TTracciato_record* tr = t_rec(mainfile);
|
||||||
@ -520,6 +528,7 @@ int TFile_text::autosave(int mainfile, const TRecord_text& rec)
|
|||||||
const TString& type = rec.type();//prendo il tracciato record del tipo del record_text
|
const TString& type = rec.type();//prendo il tracciato record del tipo del record_text
|
||||||
TTracciato_record* tr = t_rec(type);
|
TTracciato_record* tr = t_rec(type);
|
||||||
if (tr)
|
if (tr)
|
||||||
|
if (tr->relation())
|
||||||
if (tr->relation()->lfile().num()==mainfile)
|
if (tr->relation()->lfile().num()==mainfile)
|
||||||
return _autosave(*(tr->relation()),rec, *tr);
|
return _autosave(*(tr->relation()),rec, *tr);
|
||||||
return NOERR; // l'assenza del tracciato non significa un errore
|
return NOERR; // l'assenza del tracciato non significa un errore
|
||||||
@ -691,7 +700,7 @@ 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 = record.length(tc.name());
|
int length = tc.field().len(record);
|
||||||
if (!fpicture(tc).blank())
|
if (!fpicture(tc).blank())
|
||||||
{ TString tmp;
|
{ TString tmp;
|
||||||
tmp.picture(fpicture(tc), campo);
|
tmp.picture(fpicture(tc), campo);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user