#include "support/lyxalgo.h"
#include "support/std_ostream.h"
-using lyx::docstring;
-using lyx::support::escape;
+
+namespace lyx {
+
+using support::escape;
using std::string;
using std::ostream;
}
-void InsetLabel::getLabelList(Buffer const &, std::vector<string> & list) const
+void InsetLabel::getLabelList(Buffer const &, std::vector<docstring> & list) const
{
- list.push_back(getContents());
+ list.push_back(getParam("name"));
}
docstring const InsetLabel::getScreenLabel(Buffer const &) const
{
- // FIXME UNICODE
- return lyx::from_utf8(getContents());
+ return getParam("name");
}
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
- InsetCommandParams p;
- InsetCommandMailer::string2params("label", lyx::to_utf8(cmd.argument()), p);
+ InsetCommandParams p("label");
+ // FIXME UNICODE
+ InsetCommandMailer::string2params("label", to_utf8(cmd.argument()), p);
if (p.getCmdName().empty()) {
cur.noUpdate();
break;
}
- if (p.getContents() != params().getContents())
- cur.bv().buffer()->changeRefsIfUnique(params().getContents(),
- p.getContents(), InsetBase::REF_CODE);
+ if (p["name"] != params()["name"])
+ // FIXME UNICODE
+ cur.bv().buffer()->changeRefsIfUnique(params()["name"],
+ p["name"], InsetBase::REF_CODE);
setParams(p);
break;
}
}
-int InsetLabel::latex(Buffer const &, ostream & os,
+int InsetLabel::latex(Buffer const &, odocstream & os,
OutputParams const &) const
{
os << escape(getCommand());
}
-int InsetLabel::plaintext(Buffer const &, lyx::odocstream & os,
+int InsetLabel::plaintext(Buffer const &, odocstream & os,
OutputParams const &) const
{
- // FIXME UNICODE
- os << '<' << lyx::from_utf8(getContents()) << '>';
+ os << '<' << getParam("name") << '>';
return 0;
}
-int InsetLabel::docbook(Buffer const & buf, ostream & os,
+int InsetLabel::docbook(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
- os << "<!-- anchor id=\"" << sgml::cleanID(buf, runparams, getContents()) << "\" -->";
+ os << "<!-- anchor id=\""
+ << sgml::cleanID(buf, runparams, getParam("name"))
+ << "\" -->";
return 0;
}
+
+
+} // namespace lyx