#include "outputparams.h"
#include "sgml.h"
-using lyx::docstring;
+
+namespace lyx {
using std::string;
using std::auto_ptr;
RefInset::RefInset()
- : CommandInset("ref")
+ : CommandInset(from_ascii("ref"))
{}
-RefInset::RefInset(string const & data)
+RefInset::RefInset(docstring const & data)
: CommandInset(data)
{}
}
-void RefInset::infoize(std::ostream & os) const
+void RefInset::infoize(odocstream & os) const
{
os << "Ref: " << cell(0);
}
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "ref") {
MathArray ar;
- if (createInsetMath_fromDialogStr(lyx::to_utf8(cmd.argument()), ar)) {
+ if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
*this = *ar[0].nucleus()->asRefInset();
break;
}
case LFUN_MOUSE_RELEASE:
if (cmd.button() == mouse_button::button3) {
- lyxerr << "trying to goto ref '" << asString(cell(0)) << "'" << endl;
+ lyxerr << "trying to goto ref '" << to_utf8(asString(cell(0))) << "'" << endl;
cur.bv().dispatch(FuncRequest(LFUN_LABEL_GOTO, asString(cell(0))));
break;
}
docstring const RefInset::screenLabel() const
{
docstring str;
- for (int i = 0; !types[i].latex_name.empty(); ++i)
+ for (int i = 0; !types[i].latex_name.empty(); ++i) {
if (commandname() == types[i].latex_name) {
- str = _(types[i].short_gui_name);
+ str = _(to_utf8(types[i].short_gui_name));
break;
}
- // FIXME UNICODE
- str += lyx::from_utf8(asString(cell(0)));
+ }
+ str += asString(cell(0));
//if (/* !isLatex && */ !cell(0).empty()) {
// str += "||";
}
-int RefInset::plaintext(lyx::odocstream & os, OutputParams const &) const
+int RefInset::plaintext(odocstream & os, OutputParams const &) const
{
// FIXME UNICODE
- os << '[' << lyx::from_utf8(asString(cell(0))) << ']';
+ os << '[' << asString(cell(0)) << ']';
return 0;
}
-int RefInset::docbook(Buffer const & buf, std::ostream & os, OutputParams const & runparams) const
+int RefInset::docbook(Buffer const & buf, odocstream & os,
+ OutputParams const & runparams) const
{
if (cell(1).empty()) {
- os << "<xref linkend=\"" << sgml::cleanID(buf, runparams, asString(cell(0)));
+ os << "<xref linkend=\""
+ << sgml::cleanID(buf, runparams, asString(cell(0)));
if (runparams.flavor == OutputParams::XML)
os << "\"/>";
else
os << "\">";
} else {
- os << "<link linkend=\"" << sgml::cleanID(buf, runparams, asString(cell(0)))
- << "\">" << asString(cell(1)) << "</link>";
+ os << "<link linkend=\""
+ << sgml::cleanID(buf, runparams, asString(cell(0)))
+ << "\">"
+ << asString(cell(1))
+ << "</link>";
}
return 0;
RefInset::ref_type_info RefInset::types[] = {
- { "ref", N_("Standard"), N_("Ref: ")},
- { "eqref", N_("Equation"), N_("EqRef: ")},
- { "pageref", N_("Page Number"), N_("Page: ")},
- { "vpageref", N_("Textual Page Number"), N_("TextPage: ")},
- { "vref", N_("Standard+Textual Page"), N_("Ref+Text: ")},
- { "prettyref", N_("PrettyRef"), N_("PrettyRef: ")},
- { "", "", "" }
+ { from_ascii("ref"), from_ascii(N_("Standard")), from_ascii(N_("Ref: "))},
+ { from_ascii("eqref"), from_ascii(N_("Equation")), from_ascii(N_("EqRef: "))},
+ { from_ascii("pageref"), from_ascii(N_("Page Number")), from_ascii(N_("Page: "))},
+ { from_ascii("vpageref"), from_ascii(N_("Textual Page Number")), from_ascii(N_("TextPage: "))},
+ { from_ascii("vref"), from_ascii(N_("Standard+Textual Page")), from_ascii(N_("Ref+Text: "))},
+ { from_ascii("prettyref"), from_ascii(N_("PrettyRef")), from_ascii(N_("PrettyRef: "))},
+ { from_ascii(""), from_ascii(""), from_ascii("") }
};
+
+
+} // namespace lyx