X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTexRow.cpp;h=780cd52af07f7ec5702a3ffca107d99f6ec7ed51;hb=dae8555234f0e5c8358b91c307d91b219c664617;hp=f95602ec3a5e27d7a8ca729cf2fef0e88bd79d3c;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/TexRow.cpp b/src/TexRow.cpp index f95602ec3a..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,8 +46,15 @@ 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) +{ + for (int i = 0; i < num_lines; ++i) { + newline(); + } +} bool TexRow::getIdFromRow(int row, int & id, int & pos) const { @@ -78,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; }