> > 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 should try this: --- string const & LyXLayout::name() const { string * name = new string(lowercase(name_)); return * name; } --- ... --- string const & LyXLayout::obsoleted_by() const { string * obsoleted_by = new string (lowercase(obsoleted_by_)); return * obsoleted_by; } --- Surprise, it works! ... And bug 221 is gone. And John's cut-change-textclass-undo bug is gone. It just seems to work, i.e. there seemingly are no further serious errors! I *hate* the above code. It demonstrates that the problem apparently was lack of allocated memory to hold the string in question, but the above is ugly. And undoubtedly leaks like a sieve. Feel free to come up with something better! Martin
msg33267/pgp00000.pgp
Description: PGP signature