]> git.lyx.org Git - features.git/commitdiff
TexRow: fix return value on invalid row input.
authorGuillaume Munch <gm@lyx.org>
Mon, 19 Oct 2015 23:51:27 +0000 (00:51 +0100)
committerGuillaume Munch <gm@lyx.org>
Mon, 19 Oct 2015 23:51:27 +0000 (00:51 +0100)
Caused loops with Sweave & Knittr compilation.

src/TexRow.cpp

index 60a3539c2936de8841de1edea38a4cda22fb3074..516aade8120be5025fbfd170e22eed97468bc677 100644 (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);
 }