} else
getLabelList(labels);
- // FIXME UNICODE
if (lyx::count(labels.begin(), labels.end(), from) > 1)
return;
docstring const ControlGraphics::browse(docstring const & in_name) const
{
- // FIXME UNICODE
docstring const title = _("Select graphics file");
// Does user clipart directory exist?
num = convert<docstring>(counter_);
// Generate the label
- label = to_utf8(
- bformat(from_ascii("%1$s %2$s:"), _(s), num));
+ label = bformat(from_ascii("%1$s %2$s:"), _(s), num);
}
}
mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET;
LCursor cur = mi.base.bv->cursor();
setLabel(cur);
- docstring dlab(label.begin(), label.end());
- labelwidth_ = theFontMetrics(mi.base.font).width(dlab);
+ labelwidth_ = theFontMetrics(mi.base.font).width(label);
dim.wid = labelwidth_;
Dimension textdim;
InsetText::metrics(mi, textdim);
// belongs to.
LCursor cur = pi.base.bv->cursor();
setLabel(cur);
- docstring dlab(label.begin(), label.end());
- // FXIME: instead of using the fontLoader metrics, we should make
- // painter::text() returns the drawn text witdh.
- labelwidth_ = theFontMetrics(pi.base.font).width(dlab);
- pi.pain.text(x, y, dlab, pi.base.font);
+ labelwidth_ = pi.pain.text(x, y, label, pi.base.font);
InsetText::draw(pi, x + labelwidth_, y);
setPosCache(pi, x, y);
}
///
virtual std::auto_ptr<InsetBase> doClone() const;
///
- mutable std::string label;
+ mutable docstring label;
///
mutable int labelwidth_;
///
int w = 0;
int a = 0;
int d = 0;
- string s(params_.type);
+ // FIXME UNICODE
+ docstring s(from_utf8(params_.type));
if (undefined())
- // FIXME UNICODE
- s = to_utf8(_("Undef: ")) + s;
- docstring ds(s.begin(), s.end());
- theFontMetrics(font).rectText(ds, w, a, d);
+ s = _("Undef: ") + s;
+ theFontMetrics(font).rectText(s, w, a, d);
dim.wid = max(dim.wid, w);
}
dim.asc += TEXT_TO_INSET_OFFSET;
int w = 0;
int a = 0;
int d = 0;
- string s(params_.type);
+ // FIXME UNICODE
+ docstring s(from_utf8(params_.type));
if (undefined())
- // FIXME UNICODE
- s = to_utf8(_("Undef: ")) + s;
- docstring ds(s.begin(), s.end());
- theFontMetrics(font).rectText(ds, w, a, d);
+ s = _("Undef: ") + s;
+ theFontMetrics(font).rectText(s, w, a, d);
pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a,
- ds, font, LColor::none, LColor::none);
+ s, font, LColor::none, LColor::none);
}
// a visual clue when the cursor is inside the inset
Dimension InsetCollapsable::dimensionCollapsed() const
{
Dimension dim;
- docstring dlab(label.begin(), label.end());
theFontMetrics(labelfont_).buttonText(
- dlab, dim.wid, dim.asc, dim.des);
+ label, dim.wid, dim.asc, dim.des);
return dim;
}
button_dim.y1 = top;
button_dim.y2 = top + dimc.height();
- docstring dlab(label.begin(), label.end());
- pi.pain.buttonText(xx, top + dimc.asc, dlab, labelfont_);
+ pi.pain.buttonText(xx, top + dimc.asc, label, labelfont_);
if (status() == Open) {
int textx, texty;
runparams.exportdata->addExternalFile("docbook-xml", writefile,
exportfile);
- // FIXME UNICODE
if (isVerbatim(params_)) {
os << "<inlinegraphic fileref=\""
<< '&' << include_label << ';'
}
-string const InsetVSpace::label() const
+docstring const InsetVSpace::label() const
{
+ static docstring const label = _("Vertical Space");
// FIXME UNICODE
- static string const label = to_utf8(_("Vertical Space"));
- return label + " (" + space_.asGUIName() + ')';
+ return label + " (" + from_utf8(space_.asGUIName()) + ')';
}
int w = 0;
int a = 0;
int d = 0;
- string lab = label();
- docstring dlab(lab.begin(), lab.end());
- theFontMetrics(font).rectText(dlab, w, a, d);
+ theFontMetrics(font).rectText(label(), w, a, d);
height = max(height, a + d);
font.setColor(LColor::added_space);
font.decSize();
font.decSize();
- string lab = label();
- docstring dlab(lab.begin(), lab.end());
- theFontMetrics(font).rectText(dlab, w, a, d);
+ docstring const lab = label();
+ theFontMetrics(font).rectText(lab, w, a, d);
pi.pain.rectText(x + 2 * arrow_size + 5,
start + (end - start) / 2 + (a - d) / 2,
- dlab, font, LColor::none, LColor::none);
+ lab, font, LColor::none, LColor::none);
// top arrow
pi.pain.line(x, ty1, midx, ty2, LColor::added_space);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
///
- std::string const label() const;
+ docstring const label() const;
///
VSpace space_;
}
-string const statusMessage(graphics::Params const & params,
+docstring const statusMessage(graphics::Params const & params,
graphics::ImageStatus status)
{
docstring ret;
}
}
- // FIXME UNICODE
- return to_utf8(ret);
+ return ret;
}
.width(justname);
}
- // FIXME UNICODE
- docstring const msg =
- from_utf8(statusMessage(params_, loader_.status()));
+ docstring const msg = statusMessage(params_, loader_.status());
if (!msg.empty()) {
msgFont.setSize(LyXFont::SIZE_TINY);
font_width = std::max(font_width,
string const justname = onlyFilename(params_.filename);
if (!justname.empty()) {
- docstring djust(justname.begin(), justname.end());
msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
y - theFontMetrics(msgFont).maxAscent() - 4,
- djust, msgFont);
+ from_utf8(justname), msgFont);
}
// Print the message.
- string const msg = statusMessage(params_, loader_.status());
+ docstring const msg = statusMessage(params_, loader_.status());
if (!msg.empty()) {
- docstring dmsg(msg.begin(), msg.end());
msgFont.setSize(LyXFont::SIZE_TINY);
pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
- y - 4, dmsg, msgFont);
+ y - 4, msg, msgFont);
}
}
}
}
-string const statusMessage(BufferView const * bv, string const & snippet)
+docstring const statusMessage(BufferView const * bv, string const & snippet)
{
BOOST_ASSERT(bv && bv->buffer());
break;
}
- // FIXME UNICODE
- return to_utf8(message);
+ return message;
}
} // namespace anon
LyXFont font(mi.base.font);
font.setFamily(LyXFont::SANS_FAMILY);
font.setSize(LyXFont::SIZE_FOOTNOTE);
- // FIXME UNICODE
- docstring const stat = from_utf8(statusMessage(mi.base.bv, snippet_));
+ docstring const stat = statusMessage(mi.base.bv, snippet_);
dim.wid = 15 + theFontMetrics(font).width(stat);
}
font.setFamily(LyXFont::SANS_FAMILY);
font.setSize(LyXFont::SIZE_FOOTNOTE);
- // FIXME UNICODE
- docstring const stat = from_utf8(statusMessage(pi.base.bv, snippet_));
+ docstring const stat = statusMessage(pi.base.bv, snippet_);
pi.pain.text(x + offset + 6,
y - theFontMetrics(font).maxAscent() - 4,
stat, font);