]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetparent.C
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetparent.C
index 8c676ebee6ee4e63253687d5e1591c063acc3593..9ded7ca7c3af5884d9749e10931925f9d6d73fd3 100644 (file)
 
 #include <config.h>
 
-
-
 #include "insetparent.h"
-#include "support/filetools.h"
 #include "BufferView.h"
 #include "frontends/LyXView.h"
 #include "support/LOstream.h"
@@ -24,7 +21,8 @@
 #include "buffer.h"
 #include "gettext.h"
 
-#include "support/BoostFormat.h"
+#include "support/filetools.h"
+#include "support/lstrings.h"
 
 using std::ostream;
 
@@ -39,31 +37,27 @@ InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool)
 
 string const InsetParent::getScreenLabel(Buffer const *) const
 {
-#if USE_BOOST_FORMAT
-       return boost::io::str(boost::format(_("Parent: %s")) % getContents());
-#else
-       return _("Parent: ") + getContents();
-#endif
-}
-
-
-void InsetParent::edit(BufferView * bv, int, int, mouse_button::state)
-{
-       bv->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
+       return bformat(_("Parent: %1$s"), getContents());
 }
 
 
-void InsetParent::edit(BufferView * bv, bool)
+dispatch_result InsetParent::localDispatch(FuncRequest const & cmd)
 {
-       edit(bv, 0, 0, mouse_button::none);
+       switch (cmd.action) {
+               case LFUN_INSET_EDIT:
+                       cmd.view()->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents()));
+                       return DISPATCHED;
+               default:
+                       return UNDISPATCHED;
+       }
 }
 
 
 // LaTeX must just ignore this command
 int InsetParent::latex(Buffer const * buf, ostream & os,
-                      bool fragile, bool free_spc) const
+                      LatexRunParams const & runparams) const
 {
        os << "%%#{lyx}";
-       InsetCommand::latex(buf, os, fragile, free_spc);
+       InsetCommand::latex(buf, os, runparams);
        return 0;
 }