Re: [Patch] Caption inset tinkering

2006-06-07 Thread Andre Poenitz
On Wed, May 31, 2006 at 05:39:17PM +, Angus Leeming wrote: Lars Gullik Bjønnes [EMAIL PROTECTED] writes: | Apart from it can be shortened by two lines: | for (size_t i = cur.depth(); i--; ) | | Now you're just being evil, André At least be explicit about the exit | condition.

Re: [Patch] Caption inset tinkering

2006-06-07 Thread Andre Poenitz
On Wed, May 31, 2006 at 05:39:17PM +, Angus Leeming wrote: Lars Gullik Bjønnes [EMAIL PROTECTED] writes: | Apart from it can be shortened by two lines: | for (size_t i = cur.depth(); i--; ) | | Now you're just being evil, André At least be explicit about the exit | condition.

Re: [Patch] Caption inset tinkering

2006-06-07 Thread Angus Leeming
Andre Poenitz [EMAIL PROTECTED] writes: As a matter of style, yes, probably. However, for PODs there's no efficiency penalty to i-- vis-à-vis --i. Urban legend. There's a difference between the 'interesting' cases whebn iterating downwards (i.e. i-- (!= 0) vs. --i = 0) Check your

Re: [Patch] Caption inset tinkering

2006-06-07 Thread Andre Poenitz
On Wed, May 31, 2006 at 05:39:17PM +, Angus Leeming wrote: > Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > > | > Apart from it can be shortened by two lines: > > | > for (size_t i = cur.depth(); i--; ) > > | > > | Now you're just being evil, André At least be explicit about the exit >

Re: [Patch] Caption inset tinkering

2006-06-07 Thread Andre Poenitz
On Wed, May 31, 2006 at 05:39:17PM +, Angus Leeming wrote: > Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > > | > Apart from it can be shortened by two lines: > > | > for (size_t i = cur.depth(); i--; ) > > | > > | Now you're just being evil, André At least be explicit about the exit >

Re: [Patch] Caption inset tinkering

2006-06-07 Thread Angus Leeming
Andre Poenitz <[EMAIL PROTECTED]> writes: > > As a matter of style, yes, probably. However, for PODs there's no efficiency > > penalty to i-- vis-à-vis --i. > Urban legend. There's a difference between the 'interesting' cases > whebn iterating downwards (i.e. i-- (!= 0) vs. --i >= 0) > Check

Re: [Patch] Caption inset tinkering

2006-06-06 Thread Andre Poenitz
On Tue, May 30, 2006 at 05:32:19PM +, Angus Leeming wrote: Andre Poenitz [EMAIL PROTECTED] writes: +void InsetCaption::setLabel(LCursor cur) const +{ + // Set caption label _only_ if the cursor is in _this_ float: + if (cur.top().text() == text_) { + string s; +

Re: [Patch] Caption inset tinkering

2006-06-06 Thread Andre Poenitz
On Tue, May 30, 2006 at 05:32:19PM +, Angus Leeming wrote: > Andre Poenitz <[EMAIL PROTECTED]> writes: > > > +void InsetCaption::setLabel(LCursor & cur) const > > > +{ > > > + // Set caption label _only_ if the cursor is in _this_ float: > > > + if (cur.top().text() == _) { > > > +

Re: [Patch] Caption inset tinkering

2006-05-31 Thread Lars Gullik Bjønnes
Angus Leeming [EMAIL PROTECTED] writes: | Andre Poenitz [EMAIL PROTECTED] writes: | +void InsetCaption::setLabel(LCursor cur) const | +{ | + // Set caption label _only_ if the cursor is in _this_ float: | + if (cur.top().text() == text_) { | + string s; | + size_t i

Re: [Patch] Caption inset tinkering

2006-05-31 Thread Angus Leeming
Lars Gullik Bjønnes [EMAIL PROTECTED] writes: | Apart from it can be shortened by two lines: | for (size_t i = cur.depth(); i--; ) | | Now you're just being evil, André At least be explicit about the exit | condition. I *think* that your code is equivalent to: | |for (size_t i =

Re: [Patch] Caption inset tinkering

2006-05-31 Thread Lars Gullik Bjønnes
Angus Leeming [EMAIL PROTECTED] writes: | How was the sailing? Windy. Parts of the trip had ~20 m/s. (Oslo - Skagen (denmark) ) The rest of the trip, sailing north along the swedish west coast was very nice. -- Lgb

Re: [Patch] Caption inset tinkering

2006-05-31 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | Andre Poenitz <[EMAIL PROTECTED]> writes: | > > +void InsetCaption::setLabel(LCursor & cur) const | > > +{ | > > + // Set caption label _only_ if the cursor is in _this_ float: | > > + if (cur.top().text() == _) { | > > + string s; | > > +

Re: [Patch] Caption inset tinkering

2006-05-31 Thread Angus Leeming
Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > | > Apart from it can be shortened by two lines: > | > for (size_t i = cur.depth(); i--; ) > | > | Now you're just being evil, André At least be explicit about the exit > | condition. I *think* that your code is equivalent to: > | > |for

Re: [Patch] Caption inset tinkering

2006-05-31 Thread Lars Gullik Bjønnes
Angus Leeming <[EMAIL PROTECTED]> writes: | How was the sailing? Windy. Parts of the trip had ~20 m/s. (Oslo -> Skagen (denmark) ) The rest of the trip, sailing north along the swedish west coast was very nice. -- Lgb

Re: [Patch] Caption inset tinkering

2006-05-30 Thread Andre Poenitz
On Sun, May 28, 2006 at 11:46:53AM +0300, Martin Vermeer wrote: +void InsetCaption::setLabel(LCursor cur) const +{ + // Set caption label _only_ if the cursor is in _this_ float: + if (cur.top().text() == text_) { + string s; + size_t i = cur.depth(); +

Re: [Patch] Caption inset tinkering

2006-05-30 Thread Angus Leeming
Andre Poenitz [EMAIL PROTECTED] writes: +void InsetCaption::setLabel(LCursor cur) const +{ + // Set caption label _only_ if the cursor is in _this_ float: + if (cur.top().text() == text_) { + string s; + size_t i = cur.depth(); + while (i

Re: [Patch] Caption inset tinkering

2006-05-30 Thread Andre Poenitz
On Sun, May 28, 2006 at 11:46:53AM +0300, Martin Vermeer wrote: > +void InsetCaption::setLabel(LCursor & cur) const > +{ > + // Set caption label _only_ if the cursor is in _this_ float: > + if (cur.top().text() == _) { > + string s; > + size_t i = cur.depth(); > +

Re: [Patch] Caption inset tinkering

2006-05-30 Thread Angus Leeming
Andre Poenitz <[EMAIL PROTECTED]> writes: > > +void InsetCaption::setLabel(LCursor & cur) const > > +{ > > + // Set caption label _only_ if the cursor is in _this_ float: > > + if (cur.top().text() == _) { > > + string s; > > + size_t i = cur.depth(); > > +

Re: [Patch] Caption inset tinkering

2006-05-29 Thread Martin Vermeer
On Sun, May 28, 2006 at 11:46:53AM +0300, Martin Vermeer wrote: I will presently commit the attached patch to insetcaption.[Ch]. This prepares the way for switching to caption insets. It still doesn't enable them... I have a separate patch in the pipeline for this. Committed: Slight

Re: [Patch] Caption inset tinkering

2006-05-29 Thread Martin Vermeer
On Sun, May 28, 2006 at 11:46:53AM +0300, Martin Vermeer wrote: > > I will presently commit the attached patch to insetcaption.[Ch]. This > prepares the way for switching to caption insets. It still doesn't enable > them... I have a separate patch in the pipeline for this. Committed:

[Patch] Caption inset tinkering

2006-05-28 Thread Martin Vermeer
I will presently commit the attached patch to insetcaption.[Ch]. This prepares the way for switching to caption insets. It still doesn't enable them... I have a separate patch in the pipeline for this. - Martin Index: insetcaption.C

[Patch] Caption inset tinkering

2006-05-28 Thread Martin Vermeer
I will presently commit the attached patch to insetcaption.[Ch]. This prepares the way for switching to caption insets. It still doesn't enable them... I have a separate patch in the pipeline for this. - Martin Index: insetcaption.C