Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | Happy? pretty much. -- Lgb

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 11:25:19AM +0200, Lars Gullik Bjønnes wrote: > I wonder... would a more explicit "uninitialized" value be in order? > > boost::optional Please not. -1 is as explicit as we need it. Andre' > -- Those who desire to give up Freedom in order to gain Security, will not hav

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 11:27:10AM +0200, Lars Gullik Bjønnes wrote: > Andre Poenitz <[EMAIL PROTECTED]> writes: > > | On Thu, Oct 09, 2003 at 11:14:04AM +0200, Lars Gullik Bjønnes wrote: > >> What type does std::distance return? We should use that for the > >> offsets. > > > | Some difference_typ

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Thu, Oct 09, 2003 at 11:12:46AM +0200, Lars Gullik Bjønnes wrote: >> | Debugging suggests that we have a problem with cursors accessing not >> | existing paragraphs. Looking at the code this might well be possible: If >> | the paragraph list is change

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Thu, Oct 09, 2003 at 11:14:04AM +0200, Lars Gullik Bjønnes wrote: >> What type does std::distance return? We should use that for the >> offsets. > | Some difference_type. > | I currently use | | typedef std::vector::difference_type par_

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | You are no way ahead of me. ^ w -- Lgb

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Angus Leeming
Andre Poenitz wrote: > Nice numbers, but you miss the point. I am currently trying to fix > crashs, not #includes.. No, I didn't miss the point. I was just being a pain in the ass. I'll try and stop that ;-) -- Angus

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 11:16:54AM +0200, Lars Gullik Bjønnes wrote: > Your first mail left a lot of explaining to be desired, a lot better > now. Not need to begin ranting. I'll try. Andre'

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 11:14:04AM +0200, Lars Gullik Bjønnes wrote: > What type does std::distance return? We should use that for the > offsets. Some difference_type. I currently use typedef std::vector::difference_type par_type; which is not _exactly_ what we need, but I've

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 11:12:46AM +0200, Lars Gullik Bjønnes wrote: > | Debugging suggests that we have a problem with cursors accessing not > | existing paragraphs. Looking at the code this might well be possible: If > | the paragraph list is changed heavily (say assigned to) we invalidate > | al

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Thu, Oct 09, 2003 at 10:46:56AM +0200, Lars Gullik Bjønnes wrote: >> Angus Leeming <[EMAIL PROTECTED]> writes: >> >> | Andre Poenitz wrote: >> >> And we've lost a few dependency on ParagraphList_fwd.h. >> | which is a non-issue in my book since it dr

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Thu, Oct 09, 2003 at 09:31:13AM +, Angus Leeming wrote: >> Andre Poenitz wrote: >> > And we've lost a few dependency on ParagraphList_fwd.h. >> which is a non-issue in my book since it drags in system files only. >> Ok, ok, so you don't like . I

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | On Thu, Oct 09, 2003 at 10:18:58AM +0200, Lars Gullik Bjønnes wrote: >> Andre Poenitz <[EMAIL PROTECTED]> writes: >> >> | This is a patch to use 'par_type' offsets to ownerParagraphs().begin() >> | in LyXCursor. >> > >> | The drawback is obvious: we hav

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 09:55:32AM +, Angus Leeming wrote: > Conclusion: the worst case is that this costs us 400secs on a full > compile. Nice numbers, but you miss the point. I am currently trying to fix crashs, not #includes.. Andre' -- Those who desire to give up Freedom in order to ga

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 10:46:56AM +0200, Lars Gullik Bjønnes wrote: > Angus Leeming <[EMAIL PROTECTED]> writes: > > | Andre Poenitz wrote: > >> And we've lost a few dependency on ParagraphList_fwd.h. > | which is a non-issue in my book since it drags in system files only. > | Ok, ok, so you don'

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 09:31:13AM +, Angus Leeming wrote: > Andre Poenitz wrote: > > And we've lost a few dependency on ParagraphList_fwd.h. > which is a non-issue in my book since it drags in system files only. > Ok, ok, so you don't like . I note that support/types.h still > drags in . Th

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
On Thu, Oct 09, 2003 at 10:18:58AM +0200, Lars Gullik Bjønnes wrote: > Andre Poenitz <[EMAIL PROTECTED]> writes: > > | This is a patch to use 'par_type' offsets to ownerParagraphs().begin() > | in LyXCursor. > > > | The drawback is obvious: we have O(n) access in some cases where we had > | O(1) b

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Angus Leeming
Lars Gullik Bjønnes wrote: > | Andre Poenitz wrote: >>> And we've lost a few dependency on ParagraphList_fwd.h. > | which is a non-issue in my book since it drags in system files > | only. Ok, ok, so you don't like . I note that > | support/types.h still drags in . > > And I claim that you can dra

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | Andre Poenitz wrote: >> And we've lost a few dependency on ParagraphList_fwd.h. | which is a non-issue in my book since it drags in system files only. | Ok, ok, so you don't like . I note that support/types.h still | drags in . And I claim that you ca

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Angus Leeming
Andre Poenitz wrote: > And we've lost a few dependency on ParagraphList_fwd.h. which is a non-issue in my book since it drags in system files only. Ok, ok, so you don't like . I note that support/types.h still drags in . -- Angus

Re: [patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | This is a patch to use 'par_type' offsets to ownerParagraphs().begin() | in LyXCursor. > | The drawback is obvious: we have O(n) access in some cases where we had | O(1) before. Only some cases? | However,I have not seen _any_ indication that this is |

[patch] store offset instead of ParagraphList::iterator in Cursor

2003-10-09 Thread Andre Poenitz
This is a patch to use 'par_type' offsets to ownerParagraphs().begin() in LyXCursor. The drawback is obvious: we have O(n) access in some cases where we had O(1) before. However,I have not seen _any_ indication that this is noticable after playing around with the UserGuide. In any case, the bene