TexRow: fix return value on invalid row input.

Caused loops with Sweave & Knittr compilation.
This commit is contained in:
Guillaume Munch 2015-10-20 00:51:27 +01:00
parent ec93693aef
commit 6f2e86dff2

View File

@ -204,15 +204,12 @@ void TexRow::append(TexRow const & texrow)
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);
}