#include <sstream>
+
+namespace lyx {
+
using std::auto_ptr;
using std::string;
using std::istringstream;
BoxTranslator const init_boxtranslator_loc()
{
// FIXME UNICODE
- BoxTranslator translator(lyx::to_utf8(_("Boxed")), InsetBox::Boxed);
- translator.addPair(lyx::to_utf8(_("Frameless")), InsetBox::Frameless);
- translator.addPair(lyx::to_utf8(_("ovalbox")), InsetBox::ovalbox);
- translator.addPair(lyx::to_utf8(_("Ovalbox")), InsetBox::Ovalbox);
- translator.addPair(lyx::to_utf8(_("Shadowbox")), InsetBox::Shadowbox);
- translator.addPair(lyx::to_utf8(_("Doublebox")), InsetBox::Doublebox);
+ BoxTranslator translator(to_utf8(_("Boxed")), InsetBox::Boxed);
+ translator.addPair(to_utf8(_("Frameless")), InsetBox::Frameless);
+ translator.addPair(to_utf8(_("ovalbox")), InsetBox::ovalbox);
+ translator.addPair(to_utf8(_("Ovalbox")), InsetBox::Ovalbox);
+ translator.addPair(to_utf8(_("Shadowbox")), InsetBox::Shadowbox);
+ translator.addPair(to_utf8(_("Doublebox")), InsetBox::Doublebox);
return translator;
}
void InsetBox::init()
{
- setInsetName("Box");
+ setInsetName(from_ascii("Box"));
setButtonLabel();
}
}
-string const InsetBox::editMessage() const
+docstring const InsetBox::editMessage() const
{
- return lyx::to_utf8(_("Opened Box Inset"));
+ return _("Opened Box Inset");
}
BoxType btype = boxtranslator().find(params_.type);
- string label;
- // FIXME UNICODE
- label += lyx::to_utf8(_("Box"));
+ docstring label;
+ label += _("Box");
label += " (";
if (btype == Frameless) {
if (params_.use_parbox)
- label += lyx::to_utf8(_("Parbox"));
+ label += _("Parbox");
else
- label += lyx::to_utf8(_("Minipage"));
+ label += _("Minipage");
} else
- label += boxtranslator_loc().find(btype);
+ // FIXME UNICODE
+ label += from_utf8(boxtranslator_loc().find(btype));
label += ")";
setLabel(label);
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
- lyxerr << "InsetBox::dispatch MODIFY" << endl;
- InsetBoxMailer::string2params(lyx::to_utf8(cmd.argument()), params_);
+ //lyxerr << "InsetBox::dispatch MODIFY" << endl;
+ InsetBoxMailer::string2params(to_utf8(cmd.argument()), params_);
setButtonLabel();
break;
}
}
InsetCollapsable::doDispatch(cur, cmd);
break;
- case LFUN_PASTE:
- case LFUN_CLIPBOARD_PASTE:
- case LFUN_PRIMARY_SELECTION_PASTE:
- InsetCollapsable::doDispatch(cur, cmd);
- if (!params_.inner_box)
- forceParagraphsToDefault(cur);
- break;
default:
InsetCollapsable::doDispatch(cur, cmd);
}
-int InsetBox::latex(Buffer const & buf, ostream & os,
+int InsetBox::latex(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
BoxType btype = boxtranslator().find(params_.type);
if (!params_.inner_box) {
os << "{\\makebox";
// Special widths, see usrguide ยง3.5
+ // FIXME UNICODE
if (params_.special != "none") {
os << "[" << params_.width.value()
- << "\\" << params_.special << "]";
+ << '\\' << from_utf8(params_.special)
+ << ']';
} else
- os << "[" << width_string << "]";
+ os << '[' << from_ascii(width_string)
+ << ']';
if (params_.hor_pos != 'c')
os << "[" << params_.hor_pos << "]";
}
os << "[" << params_.pos << "]";
if (params_.height_special == "none") {
- os << "[" << params_.height.asLatexString() << "]";
+ // FIXME UNICODE
+ os << '[' << from_ascii(params_.height.asLatexString())
+ << ']';
} else {
// Special heights
+ // FIXME UNICODE
os << "[" << params_.height.value()
- << "\\" << params_.height_special << "]";
+ << '\\' << from_utf8(params_.height_special)
+ << ']';
}
if (params_.inner_pos != params_.pos)
os << "[" << params_.inner_pos << "]";
- os << "{" << width_string << "}";
+ // FIXME UNICODE
+ os << '{' << from_ascii(width_string) << '}';
if (params_.use_parbox)
os << "{";
}
-int InsetBox::docbook(Buffer const & buf, std::ostream & os,
+int InsetBox::docbook(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
return InsetText::docbook(buf, os, runparams);
}
-int InsetBox::plaintext(Buffer const & buf, std::ostream & os,
+int InsetBox::plaintext(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
BoxType const btype = boxtranslator().find(params_.type);
lex.pushToken(token);
}
}
+
+
+} // namespace lyx