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)
bool TexRow::getIdFromRow(int row, int & id, int & pos) const
{
TextEntry t = text_none;
- bool ret = false;
if (row <= int(rowlist_.size()))
while (row > 0 && isNone(t = rowlist_[row - 1].getTextEntry()))
--row;
- if (row > 0)
- ret = true;
id = t.id;
pos = t.pos;
- return ret;
+ return !isNone(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();
}