if (!entry.is_math) {
if (text_entry_ < size())
return false;
- else
+ else {
text_entry_ = size();
+ push_back(entry);
+ return true;
+ }
}
forceAddEntry(entry);
return true;
TexRow::TextEntry const TexRow::text_none = { -1, 0 };
-TexRow::RowEntry const TexRow::row_none = { false, TexRow::text_none };
+TexRow::RowEntry const TexRow::row_none = { false, { TexRow::text_none } };
bool TexRow::isNone(TextEntry const & t)
///
docstring TexRow::asString(RowEntry const & entry)
{
- std::ostringstream t;
+ odocstringstream os;
if (entry.is_math)
- t << "(1," << entry.math.id << "," << entry.math.cell << ")";
+ os << "(1," << entry.math.id << "," << entry.math.cell << ")";
else
- t << "(0," << entry.text.id << "," << entry.text.pos << ")";
- return from_utf8( t.str() );
+ os << "(0," << entry.text.id << "," << entry.text.pos << ")";
+ return os.str();
}
///prepends the texrow to the source given by tex, for debugging purpose
void TexRow::prepend(docstring_list & tex) const
{
- int const prefix_length = 25;
+ size_type const prefix_length = 25;
if (tex.size() < rowlist_.size())
tex.resize(rowlist_.size());
std::vector<RowEntryList>::const_iterator it = rowlist_.begin();
entry += asString(*it2);
if (entry.length() < prefix_length)
entry = entry + docstring(prefix_length - entry.length(), L' ');
- int i = it - beg;
+ ptrdiff_t i = it - beg;
tex[i] = entry + " " + tex[i];
}
}