#include <sstream>
-using lyx::docstring;
-using lyx::odocstream;
+
+namespace lyx {
using std::string;
using std::auto_ptr;
namespace {
typedef Translator<std::string, InsetNoteParams::Type> NoteTranslator;
+typedef Translator<docstring, InsetNoteParams::Type> NoteTranslatorLoc;
NoteTranslator const init_notetranslator()
{
}
-NoteTranslator const init_notetranslator_loc()
+NoteTranslatorLoc const init_notetranslator_loc()
{
- // FIXME UNICODE
- NoteTranslator translator(lyx::to_utf8(_("Note")), InsetNoteParams::Note);
- translator.addPair(lyx::to_utf8(_("Comment")), InsetNoteParams::Comment);
- translator.addPair(lyx::to_utf8(_("Greyed out")), InsetNoteParams::Greyedout);
- translator.addPair(lyx::to_utf8(_("Framed")), InsetNoteParams::Framed);
- translator.addPair(lyx::to_utf8(_("Shaded")), InsetNoteParams::Shaded);
+ NoteTranslatorLoc translator(_("Note"), InsetNoteParams::Note);
+ translator.addPair(_("Comment"), InsetNoteParams::Comment);
+ translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout);
+ translator.addPair(_("Framed"), InsetNoteParams::Framed);
+ translator.addPair(_("Shaded"), InsetNoteParams::Shaded);
return translator;
}
}
-NoteTranslator const & notetranslator_loc()
+NoteTranslatorLoc const & notetranslator_loc()
{
- static NoteTranslator translator = init_notetranslator_loc();
+ static NoteTranslatorLoc translator = init_notetranslator_loc();
return translator;
}
void InsetNote::init()
{
- setInsetName("Note");
+ setInsetName(from_ascii("Note"));
setButtonLabel();
}
void InsetNote::setButtonLabel()
{
- // FIXME unicode
- docstring const label = lyx::from_utf8(notetranslator_loc().find(params_.type));
+ docstring const label = notetranslator_loc().find(params_.type);
setLabel(label);
LyXFont font(LyXFont::ALL_SANE);
switch (cmd.action) {
case LFUN_INSET_MODIFY:
- InsetNoteMailer::string2params(lyx::to_utf8(cmd.argument()), params_);
+ InsetNoteMailer::string2params(to_utf8(cmd.argument()), params_);
setButtonLabel();
break;
else if (params_.type == InsetNoteParams::Shaded)
type = "shaded";
- lyx::odocstringstream ss;
- ss << "%\n\\begin{" << lyx::from_ascii(type) << "}\n";
+ odocstringstream ss;
+ ss << "%\n\\begin{" << from_ascii(type) << "}\n";
InsetText::latex(buf, ss, runparams);
- ss << "\n\\end{" << lyx::from_ascii(type) << "}\n";
+ ss << "\n\\end{" << from_ascii(type) << "}\n";
// the space after the comment in 'a[comment] b' will be eaten by the
// comment environment since the space before b is ignored with the
// following latex output:
os << "\n</remark>\n";
// Return how many newlines we issued.
- //return int(lyx::count(str.begin(), str.end(), '\n'));
+ //return int(count(str.begin(), str.end(), '\n'));
return n + 1 + 2;
}
params.read(lex);
}
+
+
+} // namespace lyx