X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FTexRow.cpp;h=780cd52af07f7ec5702a3ffca107d99f6ec7ed51;hb=9c375cb606d7950f8f6bd31e7a841399dc7bbfb2;hp=59a8779309d76a56e51bb53052a6a2658b348741;hpb=2b65ee6030e678dc4fe00793152e2d1feea6672f;p=lyx.git diff --git a/src/TexRow.cpp b/src/TexRow.cpp index 59a8779309..780cd52af0 100644 --- a/src/TexRow.cpp +++ b/src/TexRow.cpp @@ -4,7 +4,7 @@ * Licence details can be found in the file COPYING. * * \author Matthias Ettrich - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author John Levon * * Full author contact details are available in file CREDITS. @@ -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; }