}
}
- int tmp = inset->latex(os, runparams);
+ int tmp;
+
+ try {
+ tmp = inset->latex(os, runparams);
+ } catch (EncodingException & e) {
+ // add location information and throw again.
+ e.par_id = id_;
+ e.pos = i;
+ throw(e);
+ }
if (close) {
if (running_font.language()->lang() == "farsi")
d->text_.append(s);
// FIXME: Optimize this!
- for (pos_type i = 0; i != end; ++i) {
+ for (pos_type i = oldsize; i != newsize; ++i) {
// track change
d->changes_.insert(change, i);
}
}
-docstring Paragraph::asString(bool label) const
+docstring Paragraph::asString(int options) const
{
- return asString(0, size(), label);
+ return asString(0, size(), options);
}
-docstring Paragraph::asString(pos_type beg, pos_type end, bool label) const
+docstring Paragraph::asString(pos_type beg, pos_type end, int options) const
{
-
odocstringstream os;
- if (beg == 0 && label && !d->params_.labelString().empty())
+ if (beg == 0
+ && options & AS_STR_LABEL
+ && !d->params_.labelString().empty())
os << d->params_.labelString() << ' ';
for (pos_type i = beg; i < end; ++i) {
char_type const c = d->text_[i];
if (isPrintable(c))
os.put(c);
- else if (c == META_INSET)
+ else if (c == META_INSET && options & AS_STR_INSETS)
getInset(i)->textString(os);
}
// There was no inset at the beginning, so we need to create one with
// the key and label of the one we erased.
- InsetBibitem * inset = new InsetBibitem(InsetCommandParams(BIBITEM_CODE));
- inset->setBuffer(const_cast<Buffer &>(buffer));
+ InsetBibitem * inset =
+ new InsetBibitem(buffer, InsetCommandParams(BIBITEM_CODE));
// restore values of previously deleted item in this par.
if (!oldkey.empty())
inset->setParam("key", oldkey);