X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTexRow.cpp;h=780cd52af07f7ec5702a3ffca107d99f6ec7ed51;hb=9c375cb606d7950f8f6bd31e7a841399dc7bbfb2;hp=f019c25ea31769fba74b26be224014485f430724;hpb=b6846bdace3bb9e8619faeea2a0921d7664c3a61;p=lyx.git diff --git a/src/TexRow.cpp b/src/TexRow.cpp index f019c25ea3..780cd52af0 100644 --- a/src/TexRow.cpp +++ b/src/TexRow.cpp @@ -32,8 +32,12 @@ void TexRow::reset() void TexRow::start(int id, int pos) { + if (started) + return; + lastid = id; lastpos = pos; + started = true; } @@ -42,6 +46,7 @@ void TexRow::newline() int const id = lastid; RowList::value_type tmp(id, lastpos); rowlist.push_back(tmp); + started = false; } void TexRow::newlines(int num_lines) @@ -84,7 +89,7 @@ int TexRow::getRowFromIdPos(int id, int pos) const } if (!foundid) return rowlist.size(); - return distance(rowlist.begin(), bestrow); + return distance(rowlist.begin(), bestrow) + 1; }