From f365532e35f321b02ec6a829bf30cba6c6adc2bc Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Thu, 4 Mar 2010 21:31:06 +0000 Subject: [PATCH] remove old "logic" git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33620 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetTabular.cpp | 33 ++++++--------------------------- src/insets/InsetTabular.h | 4 ---- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 51e1b0cc36..2dcd1ff7fc 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1302,17 +1302,6 @@ Tabular::col_type Tabular::cellColumn(idx_type cell) const } -Tabular::col_type Tabular::cellRightColumn(idx_type cell) const -{ - row_type const row = cellRow(cell); - col_type column = cellColumn(cell); - while (column < column_info.size() - 1 && - cell_info[row][column + 1].multicolumn == CELL_PART_OF_MULTICOLUMN) - ++column; - return column; -} - - void Tabular::write(ostream & os) const { // header line @@ -1529,12 +1518,6 @@ bool Tabular::isMultiColumn(idx_type cell) const } -bool Tabular::isMultiColumnReal(idx_type cell) const -{ - return cellColumn(cell) != cellRightColumn(cell) && isMultiColumn(cell); -} - - Tabular::CellData & Tabular::cellInfo(idx_type cell) const { return cell_info[cellRow(cell)][cellColumn(cell)]; @@ -2957,12 +2940,12 @@ void Tabular::plaintext(odocstream & os, vector clen(column_info.size()); if (!onlydata) { - // first all non (real) multicolumn cells! + // first all non multicolumn cells! for (col_type j = 0; j < column_info.size(); ++j) { clen[j] = 0; for (row_type i = 0; i < row_info.size(); ++i) { idx_type cell = cellIndex(i, j); - if (isMultiColumnReal(cell)) + if (isMultiColumn(cell)) continue; odocstringstream sstr; cellInset(cell)->plaintext(sstr, runparams); @@ -2970,11 +2953,11 @@ void Tabular::plaintext(odocstream & os, clen[j] = sstr.str().length(); } } - // then all (real) multicolumn cells! + // then all multicolumn cells! for (col_type j = 0; j < column_info.size(); ++j) { for (row_type i = 0; i < row_info.size(); ++i) { idx_type cell = cellIndex(i, j); - if (!isMultiColumnReal(cell) || isPartOfMultiColumn(i, j)) + if (cell_info[i][j].multicolumn != CELL_BEGIN_OF_MULTICOLUMN) continue; odocstringstream sstr; cellInset(cell)->plaintext(sstr, runparams); @@ -5436,12 +5419,8 @@ void InsetTabular::getSelection(Cursor & cur, CursorSlice const & end = cur.selEnd(); cs = tabular.cellColumn(beg.idx()); ce = tabular.cellColumn(end.idx()); - if (cs > ce) { - ce = cs; - cs = tabular.cellColumn(end.idx()); - } else { - ce = tabular.cellRightColumn(end.idx()); - } + if (cs > ce) + swap(cs, ce); rs = tabular.cellRow(beg.idx()); re = tabular.cellRow(end.idx()); diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 6a1bd18e1f..e1760ad4e1 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -375,8 +375,6 @@ public: /// bool isMultiColumn(idx_type cell) const; /// - bool isMultiColumnReal(idx_type cell) const; - /// void setMultiColumn(idx_type cell, idx_type number); /// void unsetMultiColumn(idx_type cell); @@ -395,8 +393,6 @@ public: /// col_type cellColumn(idx_type cell) const; /// - col_type cellRightColumn(idx_type cell) const; - /// void setRotateCell(idx_type cell, bool); /// bool getRotateCell(idx_type cell) const;