From: Guillaume Munch Date: Mon, 19 Oct 2015 23:51:27 +0000 (+0100) Subject: TexRow: fix return value on invalid row input. X-Git-Tag: 2.2.0alpha1~197 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6f2e86dff22140d997a9b045b67b9d79c21382ef;p=features.git TexRow: fix return value on invalid row input. Caused loops with Sweave & Knittr compilation. --- diff --git a/src/TexRow.cpp b/src/TexRow.cpp index 60a3539c29..516aade812 100644 --- a/src/TexRow.cpp +++ b/src/TexRow.cpp @@ -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); }