]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Fix gcc warning.
[lyx.git] / src / insets / InsetTabular.cpp
index c3497de3d9259dd5e9a0db8c3abc43f2d346b807..487d03b6bccfda4abc0d17a780bb7a8c0ac1db02 100644 (file)
@@ -101,75 +101,76 @@ boost::scoped_ptr<Tabular> paste_tabular;
 struct TabularFeature {
        Tabular::Feature action;
        string feature;
+       bool need_value;
 };
 
 
 TabularFeature tabularFeature[] =
 {
-       { Tabular::APPEND_ROW, "append-row" },
-       { Tabular::APPEND_COLUMN, "append-column" },
-       { Tabular::DELETE_ROW, "delete-row" },
-       { Tabular::DELETE_COLUMN, "delete-column" },
-       { Tabular::COPY_ROW, "copy-row" },
-       { Tabular::COPY_COLUMN, "copy-column" },
-       { Tabular::TOGGLE_LINE_TOP, "toggle-line-top" },
-       { Tabular::TOGGLE_LINE_BOTTOM, "toggle-line-bottom" },
-       { Tabular::TOGGLE_LINE_LEFT, "toggle-line-left" },
-       { Tabular::TOGGLE_LINE_RIGHT, "toggle-line-right" },
-       { Tabular::ALIGN_LEFT, "align-left" },
-       { Tabular::ALIGN_RIGHT, "align-right" },
-       { Tabular::ALIGN_CENTER, "align-center" },
-       { Tabular::ALIGN_BLOCK, "align-block" },
-       { Tabular::VALIGN_TOP, "valign-top" },
-       { Tabular::VALIGN_BOTTOM, "valign-bottom" },
-       { Tabular::VALIGN_MIDDLE, "valign-middle" },
-       { Tabular::M_ALIGN_LEFT, "m-align-left" },
-       { Tabular::M_ALIGN_RIGHT, "m-align-right" },
-       { Tabular::M_ALIGN_CENTER, "m-align-center" },
-       { Tabular::M_VALIGN_TOP, "m-valign-top" },
-       { Tabular::M_VALIGN_BOTTOM, "m-valign-bottom" },
-       { Tabular::M_VALIGN_MIDDLE, "m-valign-middle" },
-       { Tabular::MULTICOLUMN, "multicolumn" },
-       { Tabular::MULTIROW, "multirow" },
-       { Tabular::SET_ALL_LINES, "set-all-lines" },
-       { Tabular::UNSET_ALL_LINES, "unset-all-lines" },
-       { Tabular::SET_LONGTABULAR, "set-longtabular" },
-       { Tabular::UNSET_LONGTABULAR, "unset-longtabular" },
-       { Tabular::SET_PWIDTH, "set-pwidth" },
-       { Tabular::SET_MPWIDTH, "set-mpwidth" },
-       { Tabular::SET_ROTATE_TABULAR, "set-rotate-tabular" },
-       { Tabular::UNSET_ROTATE_TABULAR, "unset-rotate-tabular" },
-       { Tabular::TOGGLE_ROTATE_TABULAR, "toggle-rotate-tabular" },
-       { Tabular::SET_ROTATE_CELL, "set-rotate-cell" },
-       { Tabular::UNSET_ROTATE_CELL, "unset-rotate-cell" },
-       { Tabular::TOGGLE_ROTATE_CELL, "toggle-rotate-cell" },
-       { Tabular::SET_USEBOX, "set-usebox" },
-       { Tabular::SET_LTHEAD, "set-lthead" },
-       { Tabular::UNSET_LTHEAD, "unset-lthead" },
-       { Tabular::SET_LTFIRSTHEAD, "set-ltfirsthead" },
-       { Tabular::UNSET_LTFIRSTHEAD, "unset-ltfirsthead" },
-       { Tabular::SET_LTFOOT, "set-ltfoot" },
-       { Tabular::UNSET_LTFOOT, "unset-ltfoot" },
-       { Tabular::SET_LTLASTFOOT, "set-ltlastfoot" },
-       { Tabular::UNSET_LTLASTFOOT, "unset-ltlastfoot" },
-       { Tabular::SET_LTNEWPAGE, "set-ltnewpage" },
-       { Tabular::TOGGLE_LTCAPTION, "toggle-ltcaption" },
-       { Tabular::SET_SPECIAL_COLUMN, "set-special-column" },
-       { Tabular::SET_SPECIAL_MULTICOLUMN, "set-special-multicolumn" },
-       { Tabular::SET_SPECIAL_MULTIROW, "set-special-multirow" },
-       { Tabular::SET_BOOKTABS, "set-booktabs" },
-       { Tabular::UNSET_BOOKTABS, "unset-booktabs" },
-       { Tabular::SET_TOP_SPACE, "set-top-space" },
-       { Tabular::SET_BOTTOM_SPACE, "set-bottom-space" },
-       { Tabular::SET_INTERLINE_SPACE, "set-interline-space" },
-       { Tabular::SET_BORDER_LINES, "set-border-lines" },
+       { Tabular::APPEND_ROW, "append-row", false },
+       { Tabular::APPEND_COLUMN, "append-column", false },
+       { Tabular::DELETE_ROW, "delete-row", false },
+       { Tabular::DELETE_COLUMN, "delete-column", false },
+       { Tabular::COPY_ROW, "copy-row", false },
+       { Tabular::COPY_COLUMN, "copy-column", false },
+       { Tabular::TOGGLE_LINE_TOP, "toggle-line-top", false },
+       { Tabular::TOGGLE_LINE_BOTTOM, "toggle-line-bottom", false },
+       { Tabular::TOGGLE_LINE_LEFT, "toggle-line-left", false },
+       { Tabular::TOGGLE_LINE_RIGHT, "toggle-line-right", false },
+       { Tabular::ALIGN_LEFT, "align-left", false },
+       { Tabular::ALIGN_RIGHT, "align-right", false },
+       { Tabular::ALIGN_CENTER, "align-center", false },
+       { Tabular::ALIGN_BLOCK, "align-block", false },
+       { Tabular::VALIGN_TOP, "valign-top", false },
+       { Tabular::VALIGN_BOTTOM, "valign-bottom", false },
+       { Tabular::VALIGN_MIDDLE, "valign-middle", false },
+       { Tabular::M_ALIGN_LEFT, "m-align-left", false },
+       { Tabular::M_ALIGN_RIGHT, "m-align-right", false },
+       { Tabular::M_ALIGN_CENTER, "m-align-center", false },
+       { Tabular::M_VALIGN_TOP, "m-valign-top", false },
+       { Tabular::M_VALIGN_BOTTOM, "m-valign-bottom", false },
+       { Tabular::M_VALIGN_MIDDLE, "m-valign-middle", false },
+       { Tabular::MULTICOLUMN, "multicolumn", false },
+       { Tabular::MULTIROW, "multirow", false },
+       { Tabular::SET_ALL_LINES, "set-all-lines", false },
+       { Tabular::UNSET_ALL_LINES, "unset-all-lines", false },
+       { Tabular::SET_LONGTABULAR, "set-longtabular", false },
+       { Tabular::UNSET_LONGTABULAR, "unset-longtabular", false },
+       { Tabular::SET_PWIDTH, "set-pwidth", true },
+       { Tabular::SET_MPWIDTH, "set-mpwidth", true },
+       { Tabular::SET_ROTATE_TABULAR, "set-rotate-tabular", false },
+       { Tabular::UNSET_ROTATE_TABULAR, "unset-rotate-tabular", false },
+       { Tabular::TOGGLE_ROTATE_TABULAR, "toggle-rotate-tabular", false },
+       { Tabular::SET_ROTATE_CELL, "set-rotate-cell", false },
+       { Tabular::UNSET_ROTATE_CELL, "unset-rotate-cell", false },
+       { Tabular::TOGGLE_ROTATE_CELL, "toggle-rotate-cell", false },
+       { Tabular::SET_USEBOX, "set-usebox", true },
+       { Tabular::SET_LTHEAD, "set-lthead", true },
+       { Tabular::UNSET_LTHEAD, "unset-lthead", true },
+       { Tabular::SET_LTFIRSTHEAD, "set-ltfirsthead", true },
+       { Tabular::UNSET_LTFIRSTHEAD, "unset-ltfirsthead", true },
+       { Tabular::SET_LTFOOT, "set-ltfoot", true },
+       { Tabular::UNSET_LTFOOT, "unset-ltfoot", true },
+       { Tabular::SET_LTLASTFOOT, "set-ltlastfoot", true },
+       { Tabular::UNSET_LTLASTFOOT, "unset-ltlastfoot", true },
+       { Tabular::SET_LTNEWPAGE, "set-ltnewpage", false },
+       { Tabular::TOGGLE_LTCAPTION, "toggle-ltcaption", false },
+       { Tabular::SET_SPECIAL_COLUMN, "set-special-column", true },
+       { Tabular::SET_SPECIAL_MULTICOLUMN, "set-special-multicolumn", true },
+       { Tabular::SET_SPECIAL_MULTIROW, "set-special-multirow", false },
+       { Tabular::SET_BOOKTABS, "set-booktabs", false },
+       { Tabular::UNSET_BOOKTABS, "unset-booktabs", false },
+       { Tabular::SET_TOP_SPACE, "set-top-space", true },
+       { Tabular::SET_BOTTOM_SPACE, "set-bottom-space", true },
+       { Tabular::SET_INTERLINE_SPACE, "set-interline-space", true },
+       { Tabular::SET_BORDER_LINES, "set-border-lines", false },
        { Tabular::TABULAR_VALIGN_TOP, "tabular-valign-top"},
        { Tabular::TABULAR_VALIGN_MIDDLE, "tabular-valign-middle"},
        { Tabular::TABULAR_VALIGN_BOTTOM, "tabular-valign-bottom"},
-       { Tabular::LONGTABULAR_ALIGN_LEFT, "longtabular-align-left" },
-       { Tabular::LONGTABULAR_ALIGN_CENTER, "longtabular-align-center" },
-       { Tabular::LONGTABULAR_ALIGN_RIGHT, "longtabular-align-right" },        
-       { Tabular::LAST_ACTION, "" }
+       { Tabular::LONGTABULAR_ALIGN_LEFT, "longtabular-align-left", false },
+       { Tabular::LONGTABULAR_ALIGN_CENTER, "longtabular-align-center", false },
+       { Tabular::LONGTABULAR_ALIGN_RIGHT, "longtabular-align-right", false },
+       { Tabular::LAST_ACTION, "", false }
 };
 
 
@@ -835,9 +836,8 @@ void Tabular::updateIndexes()
 }
 
 
-Tabular::idx_type Tabular::numberOfCellsInRow(idx_type const cell) const
+Tabular::idx_type Tabular::numberOfCellsInRow(row_type const row) const
 {
-       row_type const row = cellRow(cell);
        idx_type result = 0;
        for (col_type i = 0; i < column_info.size(); ++i)
                if (cell_info[row][i].multicolumn != Tabular::CELL_PART_OF_MULTICOLUMN)
@@ -1303,28 +1303,19 @@ int Tabular::textVOffset(idx_type cell) const
 
 Tabular::idx_type Tabular::getFirstCellInRow(row_type row) const
 {
-       if (row > row_info.size() - 1)
-               row = row_info.size() - 1;
-
        col_type c = 0;
        while (cell_info[row][c].multirow == CELL_PART_OF_MULTIROW)
                ++c;
-
-       return cell_info[row][0].cellno;
-}
-
-
-bool Tabular::isLastCellInRow(idx_type cell) const
-{
-       return cellRightColumn(cell) == column_info.size() - 1;
+       return cell_info[row][c].cellno;
 }
 
 
 Tabular::idx_type Tabular::getLastCellInRow(row_type row) const
 {
-       if (row > row_info.size() - 1)
-               row = row_info.size() - 1;
-       return cell_info[row][column_info.size() - 1].cellno;
+       col_type c = column_info.size() - 1;
+       while (cell_info[row][c].multirow == CELL_PART_OF_MULTIROW)
+               --c;
+       return cell_info[row][c].cellno;
 }
 
 
@@ -1654,7 +1645,6 @@ Tabular::idx_type Tabular::rowSpan(idx_type cell) const
 {
        row_type const nrows = row_info.size();
        col_type const column = cellColumn(cell);
-       idx_type result = 1;
        col_type row = cellRow(cell) + 1;
        while (row < nrows && isPartOfMultiRow(row, column))
                ++row;
@@ -1888,7 +1878,7 @@ Tabular::idx_type Tabular::setLTCaption(row_type row, bool what)
 {
        idx_type i = getFirstCellInRow(row);
        if (what) {
-               setMultiColumn(i, numberOfCellsInRow(i));
+               setMultiColumn(i, numberOfCellsInRow(row));
                setTopLine(i, false);
                setBottomLine(i, false);
                setLeftLine(i, false);
@@ -2441,7 +2431,7 @@ int Tabular::TeXRow(odocstream & os, row_type i,
                        os << '}';
 
                ret += TeXCellPostamble(os, cell, ismulticol, ismultirow);
-               if (!isLastCellInRow(cell)) { // not last cell in row
+               if (cell != getLastCellInRow(i)) { // not last cell in row
                        os << " & ";
                }
        }
@@ -2842,7 +2832,7 @@ bool Tabular::plaintextTopHLine(odocstream & os, row_type row,
                                   vector<unsigned int> const & clen) const
 {
        idx_type const fcell = getFirstCellInRow(row);
-       idx_type const n = numberOfCellsInRow(fcell) + fcell;
+       idx_type const n = numberOfCellsInRow(row) + fcell;
        idx_type tmp = 0;
 
        for (idx_type i = fcell; i < n; ++i) {
@@ -2890,7 +2880,7 @@ bool Tabular::plaintextBottomHLine(odocstream & os, row_type row,
                                      vector<unsigned int> const & clen) const
 {
        idx_type const fcell = getFirstCellInRow(row);
-       idx_type const n = numberOfCellsInRow(fcell) + fcell;
+       idx_type const n = numberOfCellsInRow(row) + fcell;
        idx_type tmp = 0;
 
        for (idx_type i = fcell; i < n; ++i) {
@@ -3869,14 +3859,10 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
 //     }
 
        case LFUN_LAYOUT_TABULAR:
-               cur.bv().showDialog("tabular", params2string(*this), this);
+               cur.bv().showDialog("tabular");
                break;
 
-       case LFUN_INSET_DIALOG_UPDATE:
-               cur.bv().updateDialog("tabular", params2string(*this));
-               break;
-
-       case LFUN_TABULAR_FEATURE:
+       case LFUN_INSET_MODIFY:
                if (!tabularFeatures(cur, to_utf8(cmd.argument())))
                        cur.undispatched();
                break;
@@ -4043,12 +4029,22 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
        FuncStatus & status) const
 {
        switch (cmd.action) {
-       case LFUN_TABULAR_FEATURE: {
+       case LFUN_INSET_MODIFY: {
+               istringstream is(to_utf8(cmd.argument()));
+               string s;
+               is >> s;
+               if (insetCode(s) != TABULAR_CODE) {
+                       status.clear();
+                       status.setEnabled(false);
+                       break;
+               }
+               is >> s;
+               // FIXME: We only check for the very first argument...
                int action = Tabular::LAST_ACTION;
                int i = 0;
                for (; tabularFeature[i].action != Tabular::LAST_ACTION; ++i) {
                        string const tmp = tabularFeature[i].feature;
-                       if (tmp == to_utf8(cmd.argument()).substr(0, tmp.length())) {
+                       if (tmp == s.substr(0, tmp.length())) {
                                action = tabularFeature[i].action;
                                break;
                        }
@@ -4060,7 +4056,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                }
 
                string const argument
-                       = ltrim(to_utf8(cmd.argument()).substr(tabularFeature[i].feature.length()));
+                       = ltrim(s.substr(tabularFeature[i].feature.length()));
 
                row_type sel_row_start = 0;
                row_type sel_row_end = 0;
@@ -4376,17 +4372,11 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                // relay this lfun to Inset, not to the cell.
                return Inset::getStatus(cur, cmd, status);
 
-       case LFUN_INSET_MODIFY:
-               if (insetCode(cmd.getArg(0)) == TABULAR_CODE) {
-                       status.setEnabled(true);
-                       return true;
-               }
-               // Fall through
-
        default:
                // we try to handle this event in the insets dispatch function.
                return cell(cur.idx())->getStatus(cur, cmd, status);
        }
+       return false;
 }
 
 
@@ -4647,7 +4637,7 @@ void InsetTabular::moveNextCell(Cursor & cur, EntryDirection entry_from)
        } else {
                if (tabular.isLastCell(cur.idx()))
                        return;
-               if (tabular.isLastCellInRow(cur.idx()))
+               if (cur.idx() == tabular.getLastCellInRow(row))
                        cur.idx() = tabular.cellIndex(row + 1, 0);
                else
                        cur.idx() = tabular.cellIndex(row, col + 1);
@@ -4691,7 +4681,7 @@ void InsetTabular::movePrevCell(Cursor & cur, EntryDirection entry_from)
        col_type const col = tabular.cellColumn(cur.idx());
 
        if (isRightToLeft(cur)) {
-               if (tabular.isLastCellInRow(cur.idx())) {
+               if (cur.idx() == tabular.getLastCellInRow(row)) {
                        if (row == 0)
                                return;
                        cur.idx() = tabular.getFirstCellInRow(row);
@@ -4699,7 +4689,7 @@ void InsetTabular::movePrevCell(Cursor & cur, EntryDirection entry_from)
                } else {
                        if (tabular.isLastCell(cur.idx()))
                                return;
-                       if (tabular.isLastCellInRow(cur.idx()))
+                       if (cur.idx() == tabular.getLastCellInRow(row))
                                cur.idx() = tabular.cellIndex(row + 1, 0);
                        else
                                cur.idx() = tabular.cellIndex(row, col + 1);
@@ -4743,27 +4733,45 @@ void InsetTabular::movePrevCell(Cursor & cur, EntryDirection entry_from)
 }
 
 
-bool InsetTabular::tabularFeatures(Cursor & cur, string const & what)
+bool InsetTabular::tabularFeatures(Cursor & cur, string const & argument)
 {
-       Tabular::Feature action = Tabular::LAST_ACTION;
+       istringstream is(argument);
+       string s;
+       is >> s;
+       if (insetCode(s) != TABULAR_CODE)
+               return false;
 
-       int i = 0;
-       for (; tabularFeature[i].action != Tabular::LAST_ACTION; ++i) {
-               string const tmp = tabularFeature[i].feature;
+       // Safe guard.
+       size_t safe_guard = 0;
+       for (;;) {
+               safe_guard++;
+               if (safe_guard > 1000) {
+                       LYXERR0("parameter max count reached!");
+                       break;
+               }
+               is >> s;
+               if (is.eof())
+                       break;
+               Tabular::Feature action = Tabular::LAST_ACTION;
+
+               size_t i = 0;
+               for (; tabularFeature[i].action != Tabular::LAST_ACTION; ++i) {
+                       if (s != tabularFeature[i].feature)
+                               continue;
 
-               if (tmp == what.substr(0, tmp.length())) {
-                       //if (!compare(tabularFeatures[i].feature.c_str(), what.c_str(),
-                       //tabularFeatures[i].feature.length()))
                        action = tabularFeature[i].action;
                        break;
                }
+               if (action == Tabular::LAST_ACTION) {
+                       LYXERR0("Feature not found " << s);
+                       continue;
+               }
+               string val;
+               if (tabularFeature[i].need_value)
+                       is >> val;
+               LYXERR(Debug::DEBUG, "Feature: " << s << "\t\tvalue: " << val);
+               tabularFeatures(cur, action, val);
        }
-       if (action == Tabular::LAST_ACTION)
-               return false;
-
-       string const val =
-               ltrim(what.substr(tabularFeature[i].feature.length()));
-       tabularFeatures(cur, action, val);
        return true;
 }
 
@@ -4877,7 +4885,14 @@ void InsetTabular::tabularFeatures(Cursor & cur,
 
        case Tabular::SET_SPECIAL_COLUMN:
        case Tabular::SET_SPECIAL_MULTICOLUMN:
-               tabular.setAlignSpecial(cur.idx(), from_utf8(value), feature);
+               if (value == "none")
+                       tabular.setAlignSpecial(cur.idx(), docstring(), feature);
+               else
+                       tabular.setAlignSpecial(cur.idx(), from_utf8(value), feature);
+               break;
+
+       case Tabular::SET_SPECIAL_MULTIROW:
+               //FIXME: noting to do here?
                break;
 
        case Tabular::APPEND_ROW:
@@ -4992,9 +5007,9 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                // we have a selection so this means we just add all this
                // cells to form a multicolumn cell
                idx_type const s_start = cur.selBegin().idx();
-               row_type const row_start = tabular.cellRow(s_start);
-               row_type const row_end = tabular.cellRow(cur.selEnd().idx());
-               tabular.setMultiRow(s_start, row_end - row_start + 1);
+               row_type const col_start = tabular.cellColumn(s_start);
+               row_type const col_end = tabular.cellColumn(cur.selEnd().idx());
+               tabular.setMultiColumn(s_start, col_end - col_start + 1);
                cur.idx() = s_start;
                cur.pit() = 0;
                cur.pos() = 0;
@@ -5015,12 +5030,9 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                // we have a selection so this means we just add all this
                // cells to form a multirow cell
                idx_type const s_start = cur.selBegin().idx();
-               idx_type const s_end = cur.selEnd().idx();
-               // the cell index is counted from left to right, we therefore
-               // need to know the number of columns of the table to calculate
-               // the number of selected rows
-               idx_type const ncolumns = tabular.column_info.size();
-               tabular.setMultiRow(s_start, (s_end - s_start)/ncolumns + 1);
+               row_type const row_start = tabular.cellRow(s_start);
+               row_type const row_end = tabular.cellRow(cur.selEnd().idx());
+               tabular.setMultiRow(s_start, row_end - row_start + 1);
                cur.idx() = s_start;
                cur.pit() = 0;
                cur.pos() = 0;
@@ -5206,12 +5218,12 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                if (value == "default")
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i)
                                tabular.row_info[i].top_space_default = true;
-               else if (isValidLength(value, &len))
+               else if (value == "none")
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
                                tabular.row_info[i].top_space_default = false;
                                tabular.row_info[i].top_space = len;
                        }
-               else
+               else if (isValidLength(value, &len))
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
                                tabular.row_info[i].top_space_default = false;
                                tabular.row_info[i].top_space = len;
@@ -5224,12 +5236,12 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                if (value == "default")
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i)
                                tabular.row_info[i].bottom_space_default = true;
-               else if (isValidLength(value, &len))
+               else if (value == "none")
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
                                tabular.row_info[i].bottom_space_default = false;
                                tabular.row_info[i].bottom_space = len;
                        }
-               else
+               else if (isValidLength(value, &len))
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
                                tabular.row_info[i].bottom_space_default = false;
                                tabular.row_info[i].bottom_space = len;
@@ -5242,12 +5254,12 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                if (value == "default")
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i)
                                tabular.row_info[i].interline_space_default = true;
-               else if (isValidLength(value, &len))
+               else if (value == "none")
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
                                tabular.row_info[i].interline_space_default = false;
                                tabular.row_info[i].interline_space = len;
                        }
-               else
+               else if (isValidLength(value, &len))
                        for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
                                tabular.row_info[i].interline_space_default = false;
                                tabular.row_info[i].interline_space = len;
@@ -5262,21 +5274,6 @@ void InsetTabular::tabularFeatures(Cursor & cur,
 }
 
 
-bool InsetTabular::showInsetDialog(BufferView * bv) const
-{
-       bv->showDialog("tabular", params2string(*this),
-               const_cast<InsetTabular *>(this));
-       return true;
-}
-
-
-void InsetTabular::openLayoutDialog(BufferView * bv) const
-{
-       bv->showDialog("tabular", params2string(*this),
-               const_cast<InsetTabular *>(this));
-}
-
-
 bool InsetTabular::copySelection(Cursor & cur)
 {
        if (!cur.selection())