]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.cpp
* src/frontends/controllers/Dialog.{cpp,h}:
[lyx.git] / src / mathed / InsetMathGrid.cpp
index 2d23ab4a20018a665cb6261a6e6b7f5790856fa2..a3b680dd34d21949e936d4009241ff5a29c3d10c 100644 (file)
@@ -28,8 +28,6 @@
 #include "frontends/Clipboard.h"
 #include "frontends/Painter.h"
 
-#include "insets/MailInset.h"
-
 #include "support/lstrings.h"
 
 #include <sstream>
@@ -50,31 +48,6 @@ using std::istream;
 using std::istringstream;
 using std::vector;
 
-class GridInsetMailer : public MailInset {
-public:
-       GridInsetMailer(InsetMathGrid & inset) : inset_(inset) {}
-       ///
-       virtual string const & name() const
-       {
-               static string const theName = "tabular";
-               return theName;
-       }
-       ///
-       virtual string const inset2string(Buffer const &) const
-       {
-               odocstringstream data;
-               //data << name() << " active_cell " << inset.getActCell() << '\n';
-               data << from_utf8(name()) << " active_cell " << 0 << '\n';
-               WriteStream ws(data);
-               inset_.write(ws);
-               return to_utf8(data.str());
-       }
-
-protected:
-       InsetBase & inset() const { return inset_; }
-       InsetMathGrid & inset_;
-};
-
 
 namespace {
 
@@ -184,9 +157,9 @@ InsetMathGrid::InsetMathGrid(col_type m, row_type n, char v, docstring const & h
 }
 
 
-auto_ptr<InsetBase> InsetMathGrid::doClone() const
+auto_ptr<Inset> InsetMathGrid::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetMathGrid(*this));
+       return auto_ptr<Inset>(new InsetMathGrid(*this));
 }
 
 
@@ -311,13 +284,13 @@ InsetMathGrid::row_type InsetMathGrid::row(idx_type idx) const
 }
 
 
-void InsetMathGrid::vcrskip(LyXLength const & crskip, row_type row)
+void InsetMathGrid::vcrskip(Length const & crskip, row_type row)
 {
        rowinfo_[row].crskip_ = crskip;
 }
 
 
-LyXLength InsetMathGrid::vcrskip(row_type row) const
+Length InsetMathGrid::vcrskip(row_type row) const
 {
        return rowinfo_[row].crskip_;
 }
@@ -1030,18 +1003,6 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
        //lyxerr << "*** InsetMathGrid: request: " << cmd << endl;
        switch (cmd.action) {
 
-       case LFUN_MOUSE_RELEASE:
-               //if (cmd.button() == mouse_button::button3) {
-               //      GridInsetMailer(*this).showDialog();
-               //      return DispatchResult(true, true);
-               //}
-               InsetMathNest::doDispatch(cur, cmd);
-               break;
-
-       case LFUN_INSET_DIALOG_UPDATE:
-               GridInsetMailer(*this).updateDialog(&cur.bv());
-               break;
-
        // insert file functions
        case LFUN_LINE_DELETE:
                // FIXME: We use recordUndoInset when a change reflects more
@@ -1247,7 +1208,6 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                                        cell(i).append(grid.cell(grid.index(r, c)));
                }
                cur.clearSelection(); // bug 393
-               cur.bv().switchKeyMap();
                finishUndo();
                break;
        }