Re: [Devel] Re: Fix? (Re: layout.diff (layout as string))

2002-02-20 Thread Michael Schmitt
Lars Gullik Bjønnes wrote: > | What happens if the result is stored in yet another reference and the > | function is invoked several times? -> Nasty problems! > > | const string &ref1 = foo1.name(); > | const string &ref2 = foo1.name(); > > | if ( ref1 == ref2 ) /* ref1 == ref2!!

Re: layout.diff (layout as string)

2002-02-20 Thread Martin Vermeer
On Wed, Feb 20, 2002 at 04:15:48PM +0100, Lars Gullik Bjønnes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: > > | lyxlayout.C: In method `const class string & LyXLayout::name() const': > | lyxlayout.C:740: warning: returning reference to temporary > | lyxlayout.C: In method `const class s

Re: Fix? (Re: layout.diff (layout as string))

2002-02-20 Thread michael . schmitt
By accident, I saw your message with the following code: > string const & LyXLayout::name() const >{ >string * name = new string(lowercase(name_)); >return * name; >} This code produces a memory leak each time it is invoked! Using a static function variable could help but it is not safe

Re: layout.diff (layout as string)

2002-02-20 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> mmm but there will be a lot of places that does not have a Lars> BufferParam? Not sure. Lars> I am not sure if we should do this cleanup now. The patch does Lars> not exacly make things more unclean that in already is. Agree

Re: layout.diff (layout as string)

2002-02-20 Thread Juergen Vigna
> Please put the following also in your local tree, or I suspect Bug 221 > will still be alive. This was already fixed this morning. Jug -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N

Re: layout.diff (layout as string)

2002-02-20 Thread Martin Vermeer
On Wed, Feb 20, 2002 at 04:15:48PM +0100, Lars Gullik Bjønnes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: > > | lyxlayout.C: In method `const class string & LyXLayout::name() const': > | lyxlayout.C:740: warning: returning reference to temporary > | lyxlayout.C: In method `const class s

Re: layout.diff (layout as string)

2002-02-20 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> Martin Vermeer <[EMAIL PROTECTED]> writes: | lyxlayout.C: In Lars> method `const class string & LyXLayout::name() const': | Lars> lyxlayout.C:740: warning: returning reference to temporary | Lars> lyxlayout.C: In method `const

Fix? (Re: layout.diff (layout as string))

2002-02-20 Thread Martin Vermeer
> > I have it like this in my tree now: > > string const & LyXLayout::name() const > { > name_ = lowercase(name_); > return name_; > } > > > string const & LyXLayout::obsoleted_by() const > { > obsololeted_by_ = lowercase(obsoleted_by_); > return obsoleted_by_; > } You

Re: layout.diff (layout as string)

2002-02-20 Thread Martin Vermeer
On Wed, Feb 20, 2002 at 11:54:04AM +0100, Lars Gullik Bjønnes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: ... > >> > >> Please help find the stupid problem. > > > | First-off, I see that it trips over the first starred layout (Part*) that > | it encounters. The non-starred ones before

Re: layout.diff (layout as string)

2002-02-20 Thread Martin Vermeer
On Tue, Feb 19, 2002 at 08:43:58PM +0100, Lars Gullik Bjønnes wrote: > [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: > > | And it still crashes, but should be better... > | I know there is some small stupid thing in there somewhere, but cannot > | see it. I'd be really grateful if someone els

Re: layout.diff (layout as string)

2002-02-19 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | Anyway, Lars> are you sure that using strings removes all needs to update | Lars> layouts? For example, if in the new class the given layout is Lars> obsolete | (which can be t

Re: layout.diff (layout as string)

2002-02-19 Thread John Levon
On Tue, Feb 19, 2002 at 04:58:18PM +0100, Jean-Marc Lasgouttes wrote: > Great. However, if it appears that what Martin proposes actually fixes > our problems, I suggest to defer this until after 1.2.0. does it fix undo/redo with a document class change inbetween too ? aren't there also other pr

Re: layout.diff (layout as string)

2002-02-19 Thread Juergen Vigna
On 19-Feb-2002 Martin Vermeer wrote: > This argues for a policy of storing the layouts by name IMHO. Unless we > can fix Undo/Redo too along the same lines. Well we actually would have to call the SwitchLayoutBetweenClasses for every Undo/Redo operation. This is easyly doable as I see it.

Re: layout.diff (layout as string)

2002-02-19 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: >>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: >> Lars> | Lars> The first cleanup iteration will get rid of this. >> Lars> | Great. However, if it appears that

Re: layout.diff (layout as string)

2002-02-19 Thread Martin Vermeer
On Tue, Feb 19, 2002 at 04:01:58PM +0100, Lars Gullik Bjønnes wrote: > Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: > > >> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > > > | Lars> The first cleanup iteration will get rid of this. > > > | Great. However, if it appears that

Re: layout.diff (layout as string)

2002-02-19 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> The first cleanup iteration will get rid of this. Great. However, if it appears that what Martin proposes actually fixes our problems, I suggest to defer this until after 1.2.0. JMarc

Re: layout.diff (layout as string)

2002-02-19 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | This is a close Lars> to working patch, I suspect that all that is missing | is a Lars> lowercase when reading the layouts. As it is not it crashes upon Lars> | loading a lyx fi