]> 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 8f6887eed65b3bbc28f0bd36c1f1b3109fd0d0bd..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());
+       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());
-               result = DISPATCHED;
+               return DISPATCHED;
                break;
 
        case LFUN_INSET_MODIFY: {
@@ -70,19 +69,16 @@ 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;
 }
 
 
-int InsetLabel::latex(Buffer const *, ostream & os,
+int InsetLabel::latex(Buffer const &, ostream & os,
                      LatexRunParams const &) const
 {
        os << escape(getCommand());
@@ -90,21 +86,21 @@ int InsetLabel::latex(Buffer const *, ostream & os,
 }
 
 
-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;