Corretto metodo TPrint_section::tab() e tolta la segnalazione di errore

se la prima colonna stampabile era diversa da 1.


git-svn-id: svn://10.65.10.50/trunk@2403 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-01-08 14:54:01 +00:00
parent b404553548
commit f32b35bfa1

View File

@ -2037,8 +2037,14 @@ int TPrint_section::tab(int col)
}
}
// cumulate offsets
int last = 0;
for (i = 1; i <= (word)maxcolreached; i++)
_tab[i] += _tab[i-1];
{
if (_tab[i - 1] != -1)
last = i - 1;
if (_tab[i] != -1)
_tab[i] += _tab[last];
}
}
// se manca la colonna, vai a prendere quella immediatamente prima
while (_tab[col] == -1 && col > 0)
@ -2535,14 +2541,7 @@ bool TPrint_section::edit(const char* title)
for (int i=0; i<items && !ok; i++)
{
TToken_string& tt = ms.row(i);
if (tt.get_char(prn_id - 101)=='X')
continue;
else
if (tt.get_int(col_id-101) != 1)
{
error_box("La prima colonna stampabile deve essere numerata con 1");
break;
} else ok = TRUE;
ok = tt.get_char(prn_id - 101)==' ';
}
if (i==items && !ok) error_box("Selezionare almeno una colonna stampabile.");
if (ok) break;
@ -2934,7 +2933,7 @@ TPrint_section* TForm::exist(char s, pagetype t, bool create)
TForm_item& TForm::find_field(char s, pagetype t, short id) const
{
const TPrint_section* ps = ((TForm*)this)->exist(s, t);
CHECKD(ps, "Can't find section for field %d", id);
CHECKD(ps, "Can't find section for field ", id);
return ps->find_field(id);
}