On Thu, Jan 28, 2010 at 04:17:43PM +0100, Jürgen Spitzmüller wrote:
> Jürgen Spitzmüller wrote:
> > updateLabels() in InsetMathNest's LFUN_CUT dispatch seems to fix the
> >  crash.  However, the pasted ref is not updated...
> 
> OK, now InsetMathGrid joins the party. This, additional to the above, fixes 
> the issue for me.

I would place "cur.inset().setBuffer(*cur.buffer());" just before
"cur.buffer()->updateLabels();" in order to also account for the
else case (multiple cells). Why not simply use setBuffer(*buffer_) ?

> Index: src/mathed/InsetMathGrid.cpp
> ===================================================================
> --- src/mathed/InsetMathGrid.cpp      (Revision 33238)
> +++ src/mathed/InsetMathGrid.cpp      (Arbeitskopie)
> @@ -18,6 +18,7 @@
>  #include "MathStream.h"
>  #include "MetricsInfo.h"
>  
> +#include "Buffer.h"
>  #include "BufferView.h"
>  #include "CutAndPaste.h"
>  #include "FuncStatus.h"
> @@ -1297,6 +1306,7 @@
>                       // single cell/part of cell
>                       cur.recordUndo();
>                       cur.cell().insert(cur.pos(), grid.cell(0));
> +                     cur.inset().setBuffer(*cur.buffer());
>                       cur.pos() += grid.cell(0).size();
>               } else {
>                       // multiple cells
> @@ -1322,6 +1332,7 @@
>                                       cell(i).append(grid.cell(grid.index(r, 
> c)));
>               }
>               cur.clearSelection(); // bug 393
> +             cur.buffer()->updateLabels();
>               cur.finishUndo();
>               break;
>       }


-- 
Enrico

Reply via email to