]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetlabel.C
index 66963db35005b0d03398cbd7e78de312fdfb6f78..1554760f81a4fb127833e8ff7db978e902abde85 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #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();
+       InsetCommandMailer("label", *this).hideDialog();
 }
 
 
-vector<string> const InsetLabel::getLabelList() const
+void InsetLabel::getLabelList(std::vector<string> & list) const
 {
-       return vector<string>(1, getContents());
-}
-
-
-void InsetLabel::edit(BufferView * bv, int, int, mouse_button::state)
-{
-       InsetCommandMailer mailer("label", *this);
-       mailer.showDialog(bv);
+       list.push_back(getContents());
 }
 
 
 dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
 {
-       Inset::RESULT result = UNDISPATCHED;
-
        switch (cmd.action) {
+
+       case LFUN_INSET_EDIT:
+               InsetCommandMailer("label", *this).showDialog(cmd.view());
+               return DISPATCHED;
+               break;
+
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p;
                InsetCommandMailer::string2params(cmd.argument, p);
@@ -71,47 +69,38 @@ dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
 
                setParams(p);
                cmd.view()->updateInset(this);
-               result = DISPATCHED;
+               return DISPATCHED;
        }
-       break;
 
        default:
-               result = InsetCommand::localDispatch(cmd);
+               return InsetCommand::localDispatch(cmd);
        }
-
-       return result;
-}
-
-
-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
+int InsetLabel::latex(Buffer const &, ostream & os,
+                     LatexRunParams const &) const
 {
        os << escape(getCommand());
        return 0;
 }
 
 
-int InsetLabel::ascii(Buffer const *, ostream & os, int) const
+int InsetLabel::ascii(Buffer const &, ostream & os, int) const
 {
        os << '<' << getContents()  << '>';
        return 0;
 }
 
 
-int InsetLabel::linuxdoc(Buffer const *, ostream & os) const
+int InsetLabel::linuxdoc(Buffer const &, ostream & os) const
 {
        os << "<label id=\"" << getContents() << "\" >";
        return 0;
 }
 
 
-int InsetLabel::docbook(Buffer const *, ostream & os, bool) const
+int InsetLabel::docbook(Buffer const &, ostream & os, bool) const
 {
        os << "<anchor id=\"" << getContents() << "\">";
        return 0;