On 01-Apr-2001 Lars Gullik Bjønnes wrote:
> Currently the paragraph structrue is a linked list of paragraphs,
> preferably this should change to be a std::vector<LyXParagraph> or a
> std::list<LyXParagraph>, this will mean some huge rewrites of the algorithms
> working on groups of paragraphs, but should make these algorithms a
> lot easier to understand. And featrues like outlining will be super
> simple to implement. (just have two iteratores and move everything
> between them to another location)
Well you're the expert of this but isn't it enough to just change 4
pointers to get any part of a paragraph block to any position?
// moving after the selected paragraph
LyXParagraph
*ptr1 = firstmovingpar->prev;
LyXParagraph
*ptr2 = lastmovingpar->next;
firstmovingpar->prev = destpar;
lastmovingpar->next = destpar->next;
lastmovingpar->next->prev = lastmovingpar;
firtmovingpar->prev->next = firstmovingpar;
ptr1->next = prt2;
ptr2->prev = ptr1;
This seems simple to me (and it doesn't use up a lot of memory)!
Jürgen
--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen Vigna E-Mail: [EMAIL PROTECTED]
Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Authentic:
Indubitably true, in somebody's opinion.