Fix gcc-4.4 warnings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33791 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-03-18 14:00:44 +00:00
parent 44fb52d1a2
commit bfe352d39d

View File

@ -3245,11 +3245,6 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
// store the height for every cell // store the height for every cell
// this is later needed in InsetTabular::draw to determine the valignment // 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].height = dim.asc + dim.des;
tabular.cell_info[r][c].ascent = dim.asc; tabular.cell_info[r][c].ascent = dim.asc;
tabular.cell_info[r][c].descent = dim.des; tabular.cell_info[r][c].descent = dim.des;
@ -3322,7 +3317,6 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
// determine the highest cell because its valignment sets the row valignment // determine the highest cell because its valignment sets the row valignment
// also store its height // also store its height
for (row_type r = 0; r < tabular.nrows(); ++r) { for (row_type r = 0; r < tabular.nrows(); ++r) {
int nx = x;
for (col_type c = 0; c < tabular.ncols(); ++c) { for (col_type c = 0; c < tabular.ncols(); ++c) {
if (tabular.cell_info[r][c].height >= tabular.row_info[r].maxheight) { if (tabular.cell_info[r][c].height >= tabular.row_info[r].maxheight) {
tabular.row_info[r].maxheight = tabular.cell_info[r][c].height; tabular.row_info[r].maxheight = tabular.cell_info[r][c].height;
@ -3512,8 +3506,8 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y,
Color gridcolor = change.changed() ? change.color() : Color_tabularonoffline; Color gridcolor = change.changed() ? change.color() : Color_tabularonoffline;
// Top // Top
bool drawline = tabular.topLine(cell) || row > 0 bool drawline = tabular.topLine(cell)
&& tabular.bottomLine(tabular.cellAbove(cell)); || (row > 0 && tabular.bottomLine(tabular.cellAbove(cell)));
pain.line(x, y, x + w, y, pain.line(x, y, x + w, y,
drawline ? linecolor : gridcolor, drawline ? linecolor : gridcolor,
drawline ? Painter::line_solid : Painter::line_onoffdash); drawline ? Painter::line_solid : Painter::line_onoffdash);
@ -3526,16 +3520,17 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y,
// Left // Left
col_type const col = tabular.cellColumn(cell); col_type const col = tabular.cellColumn(cell);
drawline = tabular.leftLine(cell) || col > 0 drawline = tabular.leftLine(cell)
&& tabular.rightLine(tabular.cellIndex(row, col - 1)); || (col > 0 && tabular.rightLine(tabular.cellIndex(row, col - 1)));
pain.line(x, y, x, y + h, pain.line(x, y, x, y + h,
drawline ? linecolor : gridcolor, drawline ? linecolor : gridcolor,
drawline ? Painter::line_solid : Painter::line_onoffdash); drawline ? Painter::line_solid : Painter::line_onoffdash);
// Right // Right
x -= tabular.interColumnSpace(cell); x -= tabular.interColumnSpace(cell);
drawline = tabular.rightLine(cell) || col + 1 < tabular.ncols() drawline = tabular.rightLine(cell)
&& tabular.leftLine(tabular.cellIndex(row, col + 1)); || (col + 1 < tabular.ncols()
&& tabular.leftLine(tabular.cellIndex(row, col + 1)));
pain.line(x + w, y, x + w, y + h, pain.line(x + w, y, x + w, y + h,
drawline ? linecolor : gridcolor, drawline ? linecolor : gridcolor,
drawline ? Painter::line_solid : Painter::line_onoffdash); drawline ? Painter::line_solid : Painter::line_onoffdash);