From: Georg Baum Date: Wed, 24 Nov 2004 16:48:21 +0000 (+0000) Subject: fix tabular multicolumn handling X-Git-Tag: 1.6.10~14803 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2621ad07630522cc4bff6aae6cef31677d1c14c8;p=lyx.git fix tabular multicolumn handling git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9298 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index eddd062b5b..817d078679 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2004-11-24 Georg Baum + + * insettabular.C (tabularFeatures): fix multicolumn handling + 2004-11-23 Lars Gullik Bjonnes * render_base.h (operator=): use common semantics diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index f283968386..0e87a0577a 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -1328,10 +1328,9 @@ void InsetTabular::tabularFeatures(LCursor & cur, _("You cannot set multicolumn vertically.")); return; } -#if 0 - // just multicol for one Single Cell - if (!hasSelection()) { - // check whether we are completly in a multicol + if (!cur.selection()) { + // just multicol for one single cell + // check whether we are completely in a multicol if (tabular.isMultiColumn(cur.idx())) tabular.unsetMultiColumn(cur.idx()); else @@ -1340,21 +1339,12 @@ void InsetTabular::tabularFeatures(LCursor & cur, } // we have a selection so this means we just add all this // cells to form a multicolumn cell - int s_start; - int s_end; - - if (sel_cell_start > sel_cell_end) { - s_start = sel_cell_end; - s_end = sel_cell_start; - } else { - s_start = sel_cell_start; - s_end = sel_cell_end; - } + CursorSlice::idx_type const s_start = cur.selBegin().idx(); + CursorSlice::idx_type const s_end = cur.selEnd().idx(); tabular.setMultiColumn(bv.buffer(), s_start, s_end - s_start + 1); cur.idx() = s_start; cur.par() = 0; cur.pos() = 0; -#endif cur.selection() = false; break; }