Am 17.03.2010 13:45, schrieb Vincent van Ravesteijn - TNW:

gcc 4.4.3 is throwing a lot of warnings here:

Hmm not here on MSVC. Sorry that I therefore haven't seen this.

Besides this code is truly horrific:

Why exactly is this horrific?

+       // store the height for every cell
+       // this is later needed in InsetTabular::draw to determine the 
valignment
+       int const top_space_cell = tabular.row_info[r].top_space_default ?
+       default_line_space :
+       tabular.row_info[r].top_space.inPixels(mi.base.textwidth);
+       int const bottom_space_cell = tabular.row_info[r].bottom_space_default ?
+       default_line_space :
+       tabular.cell_info[r][c].height = dim.asc + dim.des;
+       tabular.cell_info[r][c].ascent = dim.asc;
+       tabular.cell_info[r][c].descent = dim.des;

I doubt whether this is really what you meant ? You only want the height
to be set if bottom_space_default is non-zero ? Is there a line missing
?

It turned out that the top and bottom space is not necessary to be stored. These lines accidentally slipped in.

And I don't really understand the following:

+       switch (tabular.getVAlignment(tabular.cellIndex(r, c))) {
+       case Tabular::LYX_VALIGN_TOP:
+               tabular.row_info[r].valignment =
Tabular::LYX_VALIGN_TOP;
+               break;
+       case Tabular::LYX_VALIGN_MIDDLE:
+               tabular.row_info[r].valignment =
Tabular::LYX_VALIGN_MIDDLE;
+               break;
+       case Tabular::LYX_VALIGN_BOTTOM:
+               tabular.row_info[r].valignment =
Tabular::LYX_VALIGN_BOTTOM;
+               break;
+       }

Isn't this the same as:
        tabular.row_info[r].valignment =
tabular.getValignment(tabular.cellIndex(r,c));

No. We need here to know the alignment of the highest cell in the row. I therefore first determined this cell and stored its alignment as row valignment because it determines the baseline for the alignment of the other cells in the row.
You will see what I mean when playing with the valignment in the small LyX file 
I sent after my commit.

regards Uwe

Reply via email to