From b031ac1e66bef0be1579ae0e588de8bd5763acf5 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Sat, 12 Jun 2010 16:44:50 +0000 Subject: [PATCH] do not use cells without decimals when calculating column widths and cell text offsets git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34645 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index b6fd5a9241..fe9b95b962 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -962,7 +962,8 @@ bool Tabular::updateColumnWidths() for(row_type r = 0; r < nrows(); ++r) { idx_type const i = cellIndex(r, c); if (columnSpan(i) == 1) { - if (getAlignment(i) == LYX_ALIGN_DECIMAL) + if (getAlignment(i) == LYX_ALIGN_DECIMAL + && cell_info[r][c].decimal_width!=0) new_width = max(new_width, cellInfo(i).width + max_dwidth[c] - cellInfo(i).decimal_width); else @@ -1271,7 +1272,8 @@ int Tabular::textHOffset(idx_type cell) const int max_dhoffset = 0; for(row_type r = 0; r < row_info.size() ; ++r) { idx_type const i = cellIndex(r, c); - if (getAlignment(i) == LYX_ALIGN_DECIMAL) + if (getAlignment(i) == LYX_ALIGN_DECIMAL + && cellInfo(i).decimal_width != 0) max_dhoffset = max(max_dhoffset, cellInfo(i).decimal_hoffset); } x += max_dhoffset - cellInfo(cell).decimal_hoffset; -- 2.39.2