From 6f2e86dff22140d997a9b045b67b9d79c21382ef Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Tue, 20 Oct 2015 00:51:27 +0100 Subject: [PATCH] TexRow: fix return value on invalid row input. Caused loops with Sweave & Knittr compilation. --- src/TexRow.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); } -- 2.39.2