Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-10 Thread Angus Leeming
Abdelrazak Younes wrote: Bo Peng wrote: Per the use of exception, I think exception should be used more often in lyx. LyX's code base is not exception safe. The code hasn't been written with exception safety in mind, largely because we weren't proficient in the use of exceptions. (I

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-10 Thread Angus Leeming
Abdelrazak Younes wrote: Bo Peng wrote: Per the use of exception, I think exception should be used more often in lyx. LyX's code base is not exception safe. The code hasn't been written with exception safety in mind, largely because we weren't proficient in the use of exceptions. (I

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: Bo Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the use of an exception there, but on the other hand I do not have (yet) a better idea. I though of returning TocItem and let update() add the labels. However, ParConstIterator does not have a default

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-09 Thread Abdelrazak Younes
Bo Peng wrote: Bo> Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the use of an exception there, but on the other hand I do not have (yet) a better idea. I though of returning TocItem and let update() add the labels. However, ParConstIterator does not have a

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread Bo Peng
Bo Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the use of an exception there, but on the other hand I do not have (yet) a better idea. Jose, This patch works although JMarc does not like it. I can commit it with your permission or put it to bugzilla if you

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread Jean-Marc Lasgouttes
Bo == Bo Peng [EMAIL PROTECTED] writes: Bo This patch works although JMarc does not like it. To clarify: I am not against using exceptions for something else than an error, but we should make clear the kind of use we envision, not just use them on an ad-hoc basis. In this particular case, I

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread Bo Peng
In this particular case, I think that I'd prefer to pass a cursor to addToToc. Do you mean the attached? This looks better to me but I was trying not to alter the inset interface. Bo Index: src/insets/InsetCaption.cpp === ---

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread José Matos
On Monday 04 June 2007 16:59:59 Jean-Marc Lasgouttes wrote: To clarify: I am not against using exceptions for something else than an error, but we should make clear the kind of use we envision, not just use them on an ad-hoc basis. I agree with Jean-Marc here. In this particular case, I

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread Bo Peng
Bo> Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the use of an exception there, but on the other hand I do not have (yet) a better idea. Jose, This patch works although JMarc does not like it. I can commit it with your permission or put it to bugzilla if you

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Bo> This patch works although JMarc does not like it. To clarify: I am not against using exceptions for something else than an error, but we should make clear the kind of use we envision, not just use them on an ad-hoc basis. In this particular

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread Bo Peng
In this particular case, I think that I'd prefer to pass a cursor to addToToc. Do you mean the attached? This looks better to me but I was trying not to alter the inset interface. Bo Index: src/insets/InsetCaption.cpp === ---

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-04 Thread José Matos
On Monday 04 June 2007 16:59:59 Jean-Marc Lasgouttes wrote: > To clarify: I am not against using exceptions for something else than > an error, but we should make clear the kind of use we envision, not > just use them on an ad-hoc basis. I agree with Jean-Marc here. > In this particular case,

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Andre Poenitz
On Sat, Jun 02, 2007 at 12:26:48AM -0500, Bo Peng wrote: When an inset such as InsetInclude does not have a valid ParConstIterator (because it does not have valid paragraphs), it has to use the iterator of its parent paragraph. This patch implements this and add InsetInclude with a caption to

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Bo Peng
+/// thrown by an inset that does not have a valid ParConstIterator +/// so the paragraph containing this inset has to be used +class outerTocItem 'OuterTocItem' Fixed in the attached patch. Jose, OK to apply? (I assume Andre has tested this patch). Bo Index: src/insets/InsetInclude.cpp

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Jean-Marc Lasgouttes
Bo == Bo Peng [EMAIL PROTECTED] writes: +/// thrown by an inset that does not have a valid ParConstIterator +/// so the paragraph containing this inset has to be used +class outerTocItem 'OuterTocItem' Bo Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Bo Peng
Bo Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the use of an exception there, but on the other hand I do not have (yet) a better idea. I though of returning TocItem and let update() add the labels. However, ParConstIterator does not have a default constructor

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Andre Poenitz
On Sat, Jun 02, 2007 at 08:41:06AM -0500, Bo Peng wrote: +/// thrown by an inset that does not have a valid ParConstIterator +/// so the paragraph containing this inset has to be used +class outerTocItem 'OuterTocItem' Fixed in the attached patch. Jose, OK to apply? (I assume Andre has

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Andre Poenitz
On Sat, Jun 02, 2007 at 12:26:48AM -0500, Bo Peng wrote: > When an inset such as InsetInclude does not have a valid > ParConstIterator (because it does not have valid paragraphs), it has > to use the iterator of its parent paragraph. This patch implements > this and add InsetInclude with a caption

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Bo Peng
> +/// thrown by an inset that does not have a valid ParConstIterator > +/// so the paragraph containing this inset has to be used > +class outerTocItem 'OuterTocItem' Fixed in the attached patch. Jose, OK to apply? (I assume Andre has tested this patch). Bo Index: src/insets/InsetInclude.cpp

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: >> > +/// thrown by an inset that does not have a valid >> ParConstIterator > +/// so the paragraph containing this inset has >> to be used > +class outerTocItem >> >> 'OuterTocItem' Bo> Fixed in the attached patch. Jose, OK to apply? I am not

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Bo Peng
Bo> Fixed in the attached patch. Jose, OK to apply? I am not very pleased with the use of an exception there, but on the other hand I do not have (yet) a better idea. I though of returning TocItem and let update() add the labels. However, ParConstIterator does not have a default constructor

Re: [PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-02 Thread Andre Poenitz
On Sat, Jun 02, 2007 at 08:41:06AM -0500, Bo Peng wrote: > >> +/// thrown by an inset that does not have a valid ParConstIterator > >> +/// so the paragraph containing this inset has to be used > >> +class outerTocItem > > > >'OuterTocItem' > > Fixed in the attached patch. Jose, OK to apply? (I

[PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-01 Thread Bo Peng
When an inset such as InsetInclude does not have a valid ParConstIterator (because it does not have valid paragraphs), it has to use the iterator of its parent paragraph. This patch implements this and add InsetInclude with a caption to nagivation - list of listings. To test, look under

[PATCH] Bug 3711, add insets without valid ParConstIterator to TOC.

2007-06-01 Thread Bo Peng
When an inset such as InsetInclude does not have a valid ParConstIterator (because it does not have valid paragraphs), it has to use the iterator of its parent paragraph. This patch implements this and add InsetInclude with a caption to nagivation -> list of listings. To test, look under