Am 19.03.2010 02:15, schrieb Vincent van Ravesteijn - TNW:

Why exactly is this horrific?

Because you store things in variables that are not used anywhere.
Constructions with the ? And : operators, without proper spacing and
then a conditional assignment at the end, which value is also assigned
to some magic variable which is never used.

This code is indeed useless and should not have gone in:

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 :

Please apologize that mistake.

Then two lines that seem to be accidently slipped in ?

These are the superfluous lines above.

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.

Sorry, of course it is the same.

I thought you meant the second case where I embedded a switch inside a switch.
So yes, the whole switch can be replaced by

tabular.row_info[r].valignment = tabular.getVAlignment(tabular.cellIndex(r, c));

regards Uwe

Reply via email to