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.
17 #include "support/debug.h"
33 void TexRow::start(int id, int pos)
40 void TexRow::newline()
42 int const id = lastid;
43 RowList::value_type tmp(id, lastpos);
44 rowlist.push_back(tmp);
48 bool TexRow::getIdFromRow(int row, int & id, int & pos) const
50 if (row <= 0 || row > int(rowlist.size())) {
56 id = rowlist[row - 1].id();
57 pos = rowlist[row - 1].pos();
62 int TexRow::getRowFromIdPos(int id, int pos) const
67 // this loop finds the last *nonempty* row whith the same id
68 // and position <= pos
69 for (unsigned r = 0, n = rowlist.size(); r != n; ++r) {
70 if (rowlist[r].id() == id && rowlist[r].pos() <= pos) {
72 if (rowlist[bestrow].id() != id || rowlist[r].pos() > rowlist[bestrow].pos())
78 return rowlist.size();