Le SubSection columnwise ora "ereditano" le posizioni di tabulazione
dalle sezioni soprastanti (subsection o printsection) Correzione bug di valutazione scope delle variabili delle espressioni nei form git-svn-id: svn://10.65.10.50/trunk@5401 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
66fe24764c
commit
a767213989
@ -2262,7 +2262,8 @@ TExpression & TPrint_section::eval_expr(TExpression & expr,int defaultfile_id)
|
||||
{ // riferimento ad un campo di file
|
||||
TFieldref fr = TFieldref(var, 0);
|
||||
int fileno=fr.file();
|
||||
fileno=fileno==0 ? defaultfile_id: fileno;
|
||||
// choose logical file number
|
||||
fileno= (fileno==0) ? (defaultfile_id>0 ? defaultfile_id : 0): fileno;
|
||||
expr.setvar(j, fr.read( form().relation()->lfile(fileno).curr() ) ); // il valore corrente del campo viene settato nell'espressione
|
||||
}
|
||||
}
|
||||
@ -2348,20 +2349,26 @@ void TPrint_section::reset_tabs()
|
||||
int TPrint_section::tab(int col)
|
||||
{
|
||||
int ret = -1;
|
||||
int *tab=_tab;
|
||||
if (_columnwise)
|
||||
{
|
||||
if (_tab[0] == -1)
|
||||
if (tab[0] == -1 && _upsection )
|
||||
{
|
||||
// I'm the print section of a subsection: what my daddy says?
|
||||
return _upsection->section().tab(col);
|
||||
}
|
||||
if (tab[0] == -1)
|
||||
{
|
||||
// compute column offset
|
||||
_nfld = 0;
|
||||
_tab[0] = 2;
|
||||
tab[0] = 2;
|
||||
short maxcolreached = 0;
|
||||
for (word i = 0; i < fields(); i++)
|
||||
{
|
||||
if (field(i).shown())
|
||||
{
|
||||
CHECKD (field(i)._x < MAXCOLUMNS, "Colonna ammessa e non concessa: ", field(i)._x);
|
||||
_tab[field(i)._x] = field(i)._width + 1; // one is for separation
|
||||
tab[field(i)._x] = field(i)._width + 1; // one is for separation
|
||||
if (field(i)._x > maxcolreached) maxcolreached = field(i)._x;
|
||||
_nfld++;
|
||||
}
|
||||
@ -2370,16 +2377,16 @@ int TPrint_section::tab(int col)
|
||||
int last = 0;
|
||||
for (i = 1; i <= (word)maxcolreached; i++)
|
||||
{
|
||||
if (_tab[i - 1] != -1)
|
||||
if (tab[i - 1] != -1)
|
||||
last = i - 1;
|
||||
if (_tab[i] != -1)
|
||||
_tab[i] += _tab[last];
|
||||
if (tab[i] != -1)
|
||||
tab[i] += tab[last];
|
||||
}
|
||||
}
|
||||
// se manca la colonna, vai a prendere quella immediatamente prima
|
||||
while (_tab[col] == -1 && col > 0)
|
||||
while (tab[col] == -1 && col > 0)
|
||||
col--;
|
||||
ret = _tab[col];
|
||||
ret = tab[col];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -5235,14 +5242,14 @@ void TForm::read(
|
||||
pr.set_offset(_y,_x);
|
||||
if (_fontname.not_empty())
|
||||
{
|
||||
pr.set_char_size(_fontsize);
|
||||
pr.set_fontname(_fontname);
|
||||
}
|
||||
else
|
||||
{
|
||||
_fontname = pr.fontname();
|
||||
_fontsize = pr.get_char_size();
|
||||
}
|
||||
pr.set_char_size(_fontsize);
|
||||
pr.set_fontname(_fontname);
|
||||
}
|
||||
else
|
||||
{
|
||||
_fontname = pr.fontname();
|
||||
_fontsize = pr.get_char_size();
|
||||
}
|
||||
set_fink_mode(TRUE);
|
||||
|
||||
main_app().end_wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user