On 05-Jul-2001 Lars Gullik Bjønnes wrote:
> Juergen Vigna <[EMAIL PROTECTED]> writes:
>
>| As already told I fixed the showstopper and now this new Undo should work
>| properly! Please test it an let me know!
>
>
> @@ -52,6 +52,8 @@ LyXText::LyXText(BufferView * bv)
> {
> bv_owner = bv;
> inset_owner = 0;
> +#warning We should activate the below line!!! (Jug)
> +// bv->text = this;
> init();
> }
>
> No we probably should not.
> We should let the bufferview take care of that... and it already does.
Well I wouldn't write that if I wouldn't be pretty sure it's needed :),
but anyway for now I found a roundabout so it is not needed. But just
for you to know, have a look at all the functions which are called when
you initialize a LyXText at some point a inset->update() is called which
could refer to bv->text which at that moment is not yet set (well it
segfaulted here!)
So we have 3 possible solutions for this:
1. Set the above
2. In all functions we access bv->text do (if bv->text then bv->text->whatever)
3. Have the paragraph initialized with a second call so we do:
text = new LyXText(this)
text->init(buffer()->firstParagraph())
Where the last one would seem the best of all three, but 1. is true too so
why bother with 3. if we know we have to do 1. anyway?
Jürgen (who's driving his motorcycle home now)
--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen Vigna E-Mail: [EMAIL PROTECTED]
Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
brain, v: [as in "to brain"]
To rebuke bluntly, but not pointedly; to dispel a source
of error in an opponent.
-- Ambrose Bierce, "The Devil's Dictionary"