1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright (C) 1995 Matthias Ettrich
7 * Copyright (C) 1995-1999 The LyX Team.
9 * ======================================================*/
14 #pragma implementation
18 #include "lyxparagraph.h"
24 TexRow_Item *current, *iter = next;
26 // Iterate through the list deleting as you go.
27 // A bit easier to debug than recursive deletion.
38 // Defines paragraph and position for the beginning of this row
39 void TexRow::start(LyXParagraph *par, int pos) {
44 // Insert node when line is completed
45 void TexRow::newline()
47 TexRow_Item *tmp = new TexRow_Item;
51 tmp->id = lastpar->GetID();
55 // Inserts at the beginning of the list
59 tmp->rownumber = count;
63 void TexRow::getIdFromRow(int row, int &id, int &pos)
65 TexRow_Item *tmp = next;
66 while (tmp && tmp->rownumber != row) {
70 TexRow_Item *tmp2 = next;
71 // Increase the pos of all rows with the
72 // same id (and where the pos is larger)
73 // to avoid putting errorinsets at the
77 tmp2->id == tmp->id &&
78 tmp2->pos >= tmp->pos)
91 TexRow & TexRow::operator+=(const TexRow &tr)
93 // remember that the lists are stored in reverse
94 // so you've got to turn the second one around
95 // as you insert it in the first
96 for (int counter = tr.count; counter > 0; --counter) {
98 TexRow_Item *iter = tr.next;
106 tmp = new TexRow_Item;
108 tmp->pos = iter->pos;
110 tmp->rownumber = count;
113 // should I be doing this or not?
114 //lastpar = tr.lastpar;
115 //lastpos = tr.lastpos;