From: Jürgen Spitzmüller Date: Wed, 5 Oct 2011 12:57:04 +0000 (+0000) Subject: backport r39756: As for setMultiRow, check border status _before_ merging, thus fixin... X-Git-Tag: 2.0.2~170 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4bb8009f4beeedc0bcb922e863a65933a137e138;p=features.git backport r39756: As for setMultiRow, check border status _before_ merging, thus fixing border allocation problems. 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 --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index d9509a5fc9..1a2264ac89 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -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); diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 10516fe2a5..3a3f63a602 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -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); ///