}
+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::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;
}
-int LyXTabular::linuxdoc(Buffer const & buf, ostream & os,
- const OutputParams & runparams) const
-{
- os << "<tabular ca=\"";
- for (col_type i = 0; i < columns_; ++i) {
- switch (column_info[i].alignment) {
- case LYX_ALIGN_LEFT:
- os << 'l';
- break;
- case LYX_ALIGN_RIGHT:
- os << 'r';
- break;
- default:
- os << 'c';
- break;
- }
- }
- os << "\">\n";
- idx_type cell = 0;
- int ret = 0;
- for (row_type i = 0; i < rows_; ++i) {
- for (col_type j = 0; j < columns_; ++j) {
- if (isPartOfMultiColumn(i, j))
- continue;
- shared_ptr<InsetText> inset = getCellInset(cell);
-
- ret += inset->linuxdoc(buf, os, runparams);
-
- if (isLastCellInRow(cell)) {
- os << "@\n";
- ++ret;
- } else {
- os << "|";
- }
- ++cell;
- }
- }
- os << "</tabular>\n";
- return ret;
-}
-
-
int LyXTabular::docbookRow(Buffer const & buf, ostream & os, row_type row,
OutputParams const & runparams) const
{