diff --git a/src/TexRow.cpp b/src/TexRow.cpp index a18d84f543..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) diff --git a/src/TexRow.h b/src/TexRow.h index 55c9c25ff2..a4edc6c544 100644 --- a/src/TexRow.h +++ b/src/TexRow.h @@ -26,7 +26,7 @@ namespace lyx { class TexRow { public: /// - TexRow() : lastid(-1), lastpos(-1) {} + TexRow() : lastid(-1), lastpos(-1), started(false) {} /// Clears structure void reset(); @@ -90,6 +90,8 @@ private: int lastid; /// Last position int lastpos; + /// Is id/pos already registered for current row? + bool started; };