mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
TexRow: fix return value on invalid row input.
Caused loops with Sweave & Knittr compilation.
This commit is contained in:
parent
ec93693aef
commit
6f2e86dff2
@ -204,15 +204,12 @@ void TexRow::append(TexRow const & texrow)
|
|||||||
bool TexRow::getIdFromRow(int row, int & id, int & pos) const
|
bool TexRow::getIdFromRow(int row, int & id, int & pos) const
|
||||||
{
|
{
|
||||||
TextEntry t = text_none;
|
TextEntry t = text_none;
|
||||||
bool ret = false;
|
|
||||||
if (row <= int(rowlist_.size()))
|
if (row <= int(rowlist_.size()))
|
||||||
while (row > 0 && isNone(t = rowlist_[row - 1].getTextEntry()))
|
while (row > 0 && isNone(t = rowlist_[row - 1].getTextEntry()))
|
||||||
--row;
|
--row;
|
||||||
if (row > 0)
|
|
||||||
ret = true;
|
|
||||||
id = t.id;
|
id = t.id;
|
||||||
pos = t.pos;
|
pos = t.pos;
|
||||||
return ret;
|
return !isNone(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user