*
* \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)
-// : InsetCommand(p, false)
-// {}
-
-
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: {
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());
}
-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;