]> git.lyx.org Git - lyx.git/blobdiff - src/TexRow.cpp
#9130 Text in main work area isn't rendered with high resolution
[lyx.git] / src / TexRow.cpp
index ac3c7c7a723e412b64898da388f93f0618c41215..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)
@@ -68,9 +73,6 @@ bool TexRow::getIdFromRow(int row, int & id, int & pos) const
 int TexRow::getRowFromIdPos(int id, int pos) const
 {
        bool foundid = false;
-       //lyxerr<<"Table:";
-       //for (unsigned int i=0; i<rowlist.size(); i++)
-       //lyxerr<<i<<" (id,pos):\t"<<rowlist[i].id()<<" "<<rowlist[i].pos()<<"\n";
 
        // this loop finds the last *nonempty* row with the same id
        // and position <= pos
@@ -87,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;
 }