]> git.lyx.org Git - features.git/commitdiff
backport r39756: As for setMultiRow, check border status _before_ merging, thus fixin...
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 5 Oct 2011 12:57:04 +0000 (12:57 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 5 Oct 2011 12:57:04 +0000 (12:57 +0000)
No status entry needed; this is a complementing change to r39755.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39800 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTabular.cpp
src/insets/InsetTabular.h

index d9509a5fc9cf3831b302e3a98f7aa69f2f7f564d..1a2264ac89dc71843f41a2b164d00ca24bc9f234 100644 (file)
@@ -1615,7 +1615,8 @@ Tabular::CellData & Tabular::cellInfo(idx_type cell) const
 }
 
 
-Tabular::idx_type Tabular::setMultiColumn(idx_type cell, idx_type number)
+Tabular::idx_type Tabular::setMultiColumn(idx_type cell, idx_type number,
+                                         bool const right_border)
 {
        idx_type const col = cellColumn(cell);
        idx_type const row = cellRow(cell);
@@ -1629,7 +1630,7 @@ Tabular::idx_type Tabular::setMultiColumn(idx_type cell, idx_type number)
        if (column_info[col].alignment != LYX_ALIGN_DECIMAL)
                cs.alignment = column_info[col].alignment;
        if (col > 0)
-               setRightLine(cell, rightLine(cellIndex(row, col - 1)));
+               setRightLine(cell, right_border);
 
        for (idx_type i = 1; i < number; ++i) {
                CellData & cs1 = cellInfo(cell + i);
@@ -1954,7 +1955,7 @@ Tabular::idx_type Tabular::setLTCaption(row_type row, bool what)
 {
        idx_type i = getFirstCellInRow(row);
        if (what) {
-               setMultiColumn(i, numberOfCellsInRow(row));
+               setMultiColumn(i, numberOfCellsInRow(row), false);
                setTopLine(i, false);
                setBottomLine(i, false);
                setLeftLine(i, false);
@@ -5364,7 +5365,8 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                        // just multicol for one single cell
                        // check whether we are completely in a multicol
                        if (!tabular.isMultiColumn(cur.idx()))
-                               tabular.setMultiColumn(cur.idx(), 1);
+                               tabular.setMultiColumn(cur.idx(), 1,
+                                       tabular.rightLine(cur.idx()));
                        break;
                }
                // we have a selection so this means we just add all this
@@ -5372,7 +5374,8 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                idx_type const s_start = cur.selBegin().idx();
                row_type const col_start = tabular.cellColumn(s_start);
                row_type const col_end = tabular.cellColumn(cur.selEnd().idx());
-               cur.idx() = tabular.setMultiColumn(s_start, col_end - col_start + 1);
+               cur.idx() = tabular.setMultiColumn(s_start, col_end - col_start + 1,
+                                                  tabular.rightLine(cur.selEnd().idx()));
                cur.pit() = 0;
                cur.pos() = 0;
                cur.setSelection(false);
index 10516fe2a5b6d0860d99f15e387ce47109ffb808..3a3f63a602bd961471a2b66cd65e676026da78a2 100644 (file)
@@ -465,7 +465,8 @@ public:
        ///
        bool isMultiColumn(idx_type cell) const;
        ///
-       idx_type setMultiColumn(idx_type cell, idx_type number);
+       idx_type setMultiColumn(idx_type cell, idx_type number,
+                            bool const right_border);
        ///
        void unsetMultiColumn(idx_type cell);
        ///