]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
prevent crash when inserting minipage in table cell,
[lyx.git] / src / insets / insetlabel.C
index bdb8ede6a5890ec267105302f3bc613474acef21..9c3de2e08e31e8344455c7a94e9a89a4724b9e88 100644 (file)
 #include "support/LOstream.h"
 #include "support/lstrings.h" //frontStrip, strip
 
+using namespace lyx::support;
+
 using std::ostream;
 using std::vector;
 using std::pair;
 
 
-InsetLabel::InsetLabel(InsetCommandParams const & p, bool)
+InsetLabel::InsetLabel(InsetCommandParams const & p)
        : InsetCommand(p)
 {}
 
 
-InsetLabel::~InsetLabel()
-{
-       InsetCommandMailer mailer("label", *this);
-       mailer.hideDialog();
-}
+// InsetLabel::InsetLabel(InsetCommandParams const & p, bool)
+//     : InsetCommand(p, false)
+// {}
 
 
-vector<string> const InsetLabel::getLabelList() const
+InsetLabel::~InsetLabel()
 {
-       return vector<string>(1, getContents());
+       InsetCommandMailer("label", *this).hideDialog();
 }
 
 
-void InsetLabel::edit(BufferView * bv, int, int, mouse_button::state)
+void InsetLabel::getLabelList(std::vector<string> & list) const
 {
-       InsetCommandMailer mailer("label", *this);
-       mailer.showDialog(bv);
+       list.push_back(getContents());
 }
 
 
 dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
 {
-       Inset::RESULT result = UNDISPATCHED;
+       InsetOld::RESULT result = UNDISPATCHED;
 
        switch (cmd.action) {
+
+       case LFUN_INSET_EDIT:
+               InsetCommandMailer("label", *this).showDialog(cmd.view());
+               result = DISPATCHED;
+               break;
+
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p;
                InsetCommandMailer::string2params(cmd.argument, p);
@@ -70,7 +75,7 @@ dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
                }
 
                setParams(p);
-               cmd.view()->updateInset(this, !clean);
+               cmd.view()->updateInset(this);
                result = DISPATCHED;
        }
        break;
@@ -83,14 +88,8 @@ dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
 }
 
 
-void InsetLabel::edit(BufferView * bv, bool)
-{
-       edit(bv, 0, 0, mouse_button::none);
-}
-
-
 int InsetLabel::latex(Buffer const *, ostream & os,
-                     bool /*fragile*/, bool /*fs*/) const
+                     LatexRunParams const &) const
 {
        os << escape(getCommand());
        return 0;