On 10/2/18 8:15 AM, Jean-Marc Lasgouttes wrote: > Le 02/10/2018 à 06:24, Richard Kimberly Heck a écrit : >> There are some known issues about math insets and buffer_ pointers we've >> never sorted out. This OUGHT to be set somewhere near creation of the >> inset. The message has the status of a warning. But this problem can >> lead to a crash: See Inset::buffer(). So maybe it would be worth >> committing your patch, but with a corresponding warning such as: >> LYXERR0("Unassigned buffer_ detected in >> InsetMathGrid::doDispatch."); >> It has proven very hard to fix these kinds of bugs properly. > > I think I know what happens: copying a cell as is done in copyRow > leads to cloning the insets. However, inset cloning does not keep the > buffer_ value, which makes sense. > > The point where we know that (1) insets have been copied and (2) that > they go in a known buffer is in copyRow() as Scott proposed. > > If we want to be a bit cleaner, we can redefine MathData::setBuffer so > that it sets buffer to its contents (and use that in > InsetNest::setBuffer).
Seems sensible. RKH