1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright (C) 1995 Matthias Ettrich
7 * Copyright (C) 1995-1998 The LyX Team.
9 *======================================================*/
14 #pragma implementation
18 #include "lyxparagraph.h"
21 // $Id: texrow.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $
23 #if !defined(lint) && !defined(WITH_WARNINGS)
24 static char vcid[] = "$Id: texrow.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $";
30 TexRow_Item *current, *iter = next;
32 // Iterate through the list deleting as you go.
33 // A bit easier to debug than recursive deletion.
44 // Defines paragraph and position for the beginning of this row
45 void TexRow::start(LyXParagraph *par, int pos) {
50 // Insert node when line is completed
51 void TexRow::newline()
53 TexRow_Item *tmp = new TexRow_Item;
57 tmp->id = lastpar->GetID();
61 // Inserts at the beginning of the list
65 tmp->rownumber = count;
69 void TexRow::getIdFromRow(int row, int &id, int &pos)
71 TexRow_Item *tmp = next;
72 while (tmp && tmp->rownumber != row) {
76 TexRow_Item *tmp2 = next;
77 // Increase the pos of all rows with the
78 // same id (and where the pos is larger)
79 // to avoid putting errorinsets at the
83 tmp2->id == tmp->id &&
84 tmp2->pos >= tmp->pos)
97 TexRow & TexRow::operator+=(const TexRow &tr)
99 // remember that the lists are stored in reverse
100 // so you've got to turn the second one around
101 // as you insert it in the first
102 for (int counter = tr.count; counter > 0; --counter) {
104 TexRow_Item *iter = tr.next;
105 while (i < counter) {
112 tmp = new TexRow_Item;
114 tmp->pos = iter->pos;
116 tmp->rownumber = count;
119 // should I be doing this or not?
120 //lastpar = tr.lastpar;
121 //lastpos = tr.lastpos;