On Mon, Mar 14, 2005 at 03:11:50PM +0100, Georg Baum wrote:
> Martin Vermeer wrote:
> 
> > About the mbox bug: I did some testing, see attached. But now I am
> > stuck. It turns out that, as the asserts show, that cur.text() is null
> > in both places: before calling the inset-dispatch, and later in the
> > lyxtext's dispatch.
> 
> Did you read these two threads?
> http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg75732.html
> http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg74904.html
> 
> > I assume that at least the latter is not supposed to be the case. But I
> > don't see the right way to put "something" into cur.text(), presumably a
> > pointer/ref to text_ inside math_mboxinset.C.
> > 
> > Help!!
> 
> You sent the wrong patch ;-(
> 
> 
> Georg


Yes... here's the right one. Cursed evo.

- Martin
- Martin 
Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.580
diff -u -r1.580 BufferView_pimpl.C
--- BufferView_pimpl.C  25 Feb 2005 11:55:29 -0000      1.580
+++ BufferView_pimpl.C  14 Mar 2005 13:28:44 -0000
@@ -916,8 +916,10 @@
        // via the temp cursor. If the inset wishes to change the real
        // cursor it has to do so explicitly by using
        //  cur.bv().cursor() = cur;  (or similar)
-       if (inset)
+       if (inset) {
+               BOOST_ASSERT(cur.text());
                inset->dispatch(cur, cmd);
+       }
 
        // Now dispatch to the temporary cursor. If the real cursor should
        // be modified, the inset's dispatch has to do so explicitly.
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.286
diff -u -r1.286 text3.C
--- text3.C     7 Mar 2005 11:03:45 -0000       1.286
+++ text3.C     14 Mar 2005 13:28:44 -0000
@@ -288,7 +288,8 @@
        lyxerr[Debug::ACTION] << "LyXText::dispatch: cmd: " << cmd << endl;
        lyxerr << "*** LyXText::dispatch: cmd: " << cmd << endl;
 
-       BOOST_ASSERT(cur.text() == this);
+       //BOOST_ASSERT(cur.text() == this);
+       BOOST_ASSERT(cur.text());
        BufferView * bv = &cur.bv();
        CursorSlice oldTopSlice = cur.top();
        bool sel = cur.selection();

Attachment: pgpfDYRB23qHb.pgp
Description: PGP signature

Reply via email to