]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloatlist.C
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetfloatlist.C
index ad85096c8d84e065e5d838fd6e62a2342958819b..3a4aeee2e89dbc38d9f21ca958925ca2370fa552 100644 (file)
@@ -7,22 +7,22 @@
  *
  * Full author contact details are available in file CREDITS
  */
-#include <config.h>
 
+#include <config.h>
 
 #include "insetfloatlist.h"
 #include "FloatList.h"
 #include "LaTeXFeatures.h"
 #include "lyxlex.h"
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
 #include "BufferView.h"
+#include "funcrequest.h"
 #include "buffer.h"
 #include "toc.h"
 #include "gettext.h"
 #include "debug.h"
+#include "Lsstream.h"
 
-#include "BoostFormat.h"
+#include "support/lstrings.h"
 
 using std::ostream;
 using std::endl;
@@ -30,8 +30,7 @@ using std::endl;
 
 InsetFloatList::InsetFloatList()
        : InsetCommand(InsetCommandParams())
-{
-}
+{}
 
 
 InsetFloatList::InsetFloatList(string const & type)
@@ -41,6 +40,13 @@ InsetFloatList::InsetFloatList(string const & type)
 }
 
 
+InsetFloatList::~InsetFloatList()
+{
+       InsetCommandMailer mailer("toc", *this);
+       mailer.hideDialog();
+}
+
+
 string const InsetFloatList::getScreenLabel(Buffer const * buf) const
 {
        FloatList const & floats = buf->params.getLyXTextClass().floats();
@@ -89,19 +95,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)
 {
-       bv->owner()->getDialogs().showTOC(this);
-}
-
-
-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()];
@@ -122,19 +129,9 @@ int InsetFloatList::latex(Buffer const * buf, ostream & os, bool, bool) const
                           << cit->second.listName() << "}\n";
                }
        } else {
-#if USE_BOOST_FORMAT
-               os << "%%\\listof{"
-                  << getCmdName()
-                  << "}{"
-                  << boost::format(_("List of %1$s")) % cit->second.name()
-                  << "}\n";
-#else
-               os << "%%\\listof{"
-                  << getCmdName()
-                  << "}{"
-                  << _("List of ") << cit->second.name()
+               os << "%%\\listof{" << getCmdName() << "}{"
+                  << bformat(_("List of %1$s"), cit->second.name())
                   << "}\n";
-#endif
        }
        return 1;
 }