1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * ====================================================== */
14 #pragma implementation
18 #include "lyxparagraph.h"
32 // Defines paragraph and position for the beginning of this row
33 void TexRow::start(LyXParagraph * par, int pos)
40 // Insert node when line is completed
41 void TexRow::newline()
46 tmp.id(lastpar->id());
49 tmp.rownumber(++count);
50 rowlist.push_back(tmp);
54 void TexRow::getIdFromRow(int row, int & id, int & pos) const
56 RowList::const_iterator cit = rowlist.begin();
57 RowList::const_iterator end = rowlist.end();
58 for (; cit != end; ++cit) {
59 if ((*cit).rownumber() == row) break;
62 RowList::iterator kit = rowlist.begin();
63 // Increase the pos of all rows with the
64 // same id (and where the pos is larger)
65 // to avoid putting errorinsets at the
67 for(; kit != end; ++kit) {
68 if (&(*kit) != &(*cit)
69 && (*kit).id() == (*cit).id()
70 && (*kit).pos() >= (*cit).pos())
71 (*kit).pos((*kit).pos() + 1);
82 TexRow & TexRow::operator+= (TexRow const & tr)
84 rowlist.insert(rowlist.end(), tr.rowlist.begin(), tr.rowlist.end());