]> git.lyx.org Git - lyx.git/blobdiff - src/TexRow.cpp
- Coding style
[lyx.git] / src / TexRow.cpp
index f019c25ea31769fba74b26be224014485f430724..780cd52af07f7ec5702a3ffca107d99f6ec7ed51 100644 (file)
@@ -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;
 }