summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
864515f)
* src/insets/insettabular.C
(InsetTabular::getStatus): enable COPY_ROW and COPY_COLUMN features
(InsetTabular::tabularFeatures): handle COPY_ROW and COPY_COLUMN
* src/tabular.h
(TabularFeature): add COPY_ROW and COPY_COLUMN
* src/tabular.[Ch]
(LyXTabular::copyRow): new method, copy a row
(LyXTabular::copyColumn): new method, copy a column
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15173
a592a061-630c-0410-9148-
cb99ea01b6c8
{ LyXTabular::APPEND_COLUMN, "append-column" },
{ LyXTabular::DELETE_ROW, "delete-row" },
{ LyXTabular::DELETE_COLUMN, "delete-column" },
{ LyXTabular::APPEND_COLUMN, "append-column" },
{ LyXTabular::DELETE_ROW, "delete-row" },
{ LyXTabular::DELETE_COLUMN, "delete-column" },
+ { LyXTabular::COPY_ROW, "copy-row" },
+ { LyXTabular::COPY_COLUMN, "copy-column" },
{ LyXTabular::TOGGLE_LINE_TOP, "toggle-line-top" },
{ LyXTabular::TOGGLE_LINE_BOTTOM, "toggle-line-bottom" },
{ LyXTabular::TOGGLE_LINE_LEFT, "toggle-line-left" },
{ LyXTabular::TOGGLE_LINE_TOP, "toggle-line-top" },
{ LyXTabular::TOGGLE_LINE_BOTTOM, "toggle-line-bottom" },
{ LyXTabular::TOGGLE_LINE_LEFT, "toggle-line-left" },
case LyXTabular::APPEND_COLUMN:
case LyXTabular::DELETE_ROW:
case LyXTabular::DELETE_COLUMN:
case LyXTabular::APPEND_COLUMN:
case LyXTabular::DELETE_ROW:
case LyXTabular::DELETE_COLUMN:
+ case LyXTabular::COPY_ROW:
+ case LyXTabular::COPY_COLUMN:
case LyXTabular::SET_ALL_LINES:
case LyXTabular::UNSET_ALL_LINES:
case LyXTabular::SET_TOP_SPACE:
case LyXTabular::SET_ALL_LINES:
case LyXTabular::UNSET_ALL_LINES:
case LyXTabular::SET_TOP_SPACE:
cur.selection() = false;
break;
cur.selection() = false;
break;
+ case LyXTabular::COPY_ROW:
+ tabular.copyRow(bv.buffer()->params(), row);
+ break;
+
+ case LyXTabular::COPY_COLUMN:
+ tabular.copyColumn(bv.buffer()->params(), column);
+ cur.idx() = tabular.getCellNumber(row, column);
+ break;
+
case LyXTabular::M_TOGGLE_LINE_TOP:
flag = false;
case LyXTabular::TOGGLE_LINE_TOP: {
case LyXTabular::M_TOGGLE_LINE_TOP:
flag = false;
case LyXTabular::TOGGLE_LINE_TOP: {
+void LyXTabular::copyRow(BufferParams const & bp, row_type const row)
+{
+ ++rows_;
+
+ row_info.insert(row_info.begin() + row, row_info[row]);
+ cell_info.insert(cell_info.begin() + row, cell_info[row]);
+
+ if (bp.tracking_changes)
+ for (col_type j = 0; j < columns_; ++j)
+ cell_info[row + 1][j].inset->markNew(true);
+
+ set_row_column_number_info();
+}
+
+
void LyXTabular::appendColumn(BufferParams const & bp, idx_type const cell)
{
++columns_;
void LyXTabular::appendColumn(BufferParams const & bp, idx_type const cell)
{
++columns_;
+void LyXTabular::copyColumn(BufferParams const & bp, col_type const column)
+{
+ ++columns_;
+
+ column_info.insert(column_info.begin() + column, column_info[column]);
+
+ for (row_type i = 0; i < rows_; ++i)
+ cell_info[i].insert(cell_info[i].begin() + column, cell_info[i][column]);
+
+ if (bp.tracking_changes)
+ for (row_type i = 0; i < rows_; ++i)
+ cell_info[i][column + 1].inset->markNew(true);
+ fixCellNums();
+}
+
+
void LyXTabular::set_row_column_number_info()
{
numberofcells = 0;
void LyXTabular::set_row_column_number_info()
{
numberofcells = 0;
+ COPY_ROW,
+ ///
+ COPY_COLUMN,
+ ///
TOGGLE_LINE_TOP,
///
TOGGLE_LINE_BOTTOM,
TOGGLE_LINE_TOP,
///
TOGGLE_LINE_BOTTOM,
///
void deleteRow(row_type row);
///
///
void deleteRow(row_type row);
///
+ void copyRow(BufferParams const &, row_type);
+ ///
void appendColumn(BufferParams const &, idx_type cell);
///
void deleteColumn(col_type column);
///
void appendColumn(BufferParams const &, idx_type cell);
///
void deleteColumn(col_type column);
///
+ void copyColumn(BufferParams const &, col_type);
+ ///
bool isFirstCellInRow(idx_type cell) const;
///
idx_type getFirstCellInRow(row_type row) const;
bool isFirstCellInRow(idx_type cell) const;
///
idx_type getFirstCellInRow(row_type row) const;