]> git.lyx.org Git - lyx.git/commitdiff
fix tabular multicolumn handling
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 24 Nov 2004 16:48:21 +0000 (16:48 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Wed, 24 Nov 2004 16:48:21 +0000 (16:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9298 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettabular.C

index eddd062b5be3ddeb5d9e8527347c3c9d96e46141..817d0786790b185f9996deab92de0d8be9b79fd1 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-24  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * insettabular.C (tabularFeatures): fix multicolumn handling
+
 2004-11-23  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * render_base.h (operator=): use common semantics
index f283968386aeb035c042749a3b25e124306c7fd3..0e87a0577a7778ddd012e22d6d88543d319d3c49 100644 (file)
@@ -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;
        }