3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Matthias Ettrich
7 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
16 #include "support/debug.h"
32 void TexRow::start(int id, int pos)
39 void TexRow::newline()
41 int const id = lastid;
42 RowList::value_type tmp(id, lastpos);
43 rowlist.push_back(tmp);
47 bool TexRow::getIdFromRow(int row, int & id, int & pos) const
49 if (row <= 0 || row > int(rowlist.size())) {
55 id = rowlist[row - 1].id();
56 pos = rowlist[row - 1].pos();
61 int TexRow::getRowFromIdPos(int id, int pos) const
66 // this loop finds the last *nonempty* row whith the same id
67 // and position <= pos
68 for (unsigned r = 0, n = rowlist.size(); r != n; ++r) {
69 if (rowlist[r].id() == id && rowlist[r].pos() <= pos) {
71 if (rowlist[bestrow].id() != id || rowlist[r].pos() > rowlist[bestrow].pos())
77 return rowlist.size();