Juergen Vigna <[EMAIL PROTECTED]> writes:

| 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?

Yes... but putting this in now just makes the transformation to a
std::list harder.
 
| // 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)!

?? As opposed to what?

-- 
        Lgb

Reply via email to