]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloatlist.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetfloatlist.C
index 32779cf7712fd487a332d2529f4cfa72908b5c2c..449312d34755c639ae7e9fa9b35a262e99ce04c3 100644 (file)
@@ -15,6 +15,7 @@
 #include "LaTeXFeatures.h"
 #include "lyxlex.h"
 #include "BufferView.h"
+#include "funcrequest.h"
 #include "buffer.h"
 #include "toc.h"
 #include "gettext.h"
@@ -23,8 +24,7 @@
 
 #include "support/lstrings.h"
 
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
+using namespace lyx::support;
 
 using std::ostream;
 using std::endl;
@@ -60,9 +60,9 @@ string const InsetFloatList::getScreenLabel(Buffer const * buf) const
 }
 
 
-Inset::Code InsetFloatList::lyxCode() const
+InsetOld::Code InsetFloatList::lyxCode() const
 {
-       return Inset::FLOAT_LIST_CODE;
+       return InsetOld::FLOAT_LIST_CODE;
 }
 
 
@@ -97,20 +97,20 @@ void InsetFloatList::read(Buffer const * buf, LyXLex & lex)
 }
 
 
-void InsetFloatList::edit(BufferView * bv, int, int, mouse_button::state)
+dispatch_result InsetFloatList::localDispatch(FuncRequest const & cmd)
 {
-       InsetCommandMailer mailer("toc", *this);
-       mailer.showDialog(bv);
-}
-
-
-void InsetFloatList::edit(BufferView * bv, bool)
-{
-       edit(bv, 0, 0, mouse_button::none);
+       switch (cmd.action) {
+               case LFUN_INSET_EDIT:
+                       InsetCommandMailer("toc", *this).showDialog(cmd.view());
+                       return DISPATCHED;
+               default:
+                       return InsetCommand::localDispatch(cmd);
+       }
 }
 
 
-int InsetFloatList::latex(Buffer const * buf, ostream & os, bool, bool) const
+int InsetFloatList::latex(Buffer const * buf, ostream & os,
+                         LatexRunParams const &) const
 {
        FloatList const & floats = buf->params.getLyXTextClass().floats();
        FloatList::const_iterator cit = floats[getCmdName()];
@@ -143,7 +143,7 @@ int InsetFloatList::ascii(Buffer const * buffer, ostream & os, int) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
-       toc::asciiTocList(getCmdName(), buffer, os);
+       lyx::toc::asciiTocList(getCmdName(), buffer, os);
 
        os << "\n";
        return 0;