On Mon, Aug 14, 2006 at 05:21:49PM +0200, Jean-Marc Lasgouttes wrote:
> 
> The following patch fixes this bug for me. However I have questions
> about whether I did it right.
> 
> There are 3 mostly independent parts in the patch:
> 
> - in MathScriptInset::notifyCursorLeave, there were no recordUndoInset
>   calls. This fix seems safe and obvious to me

Worst case scenario is that an additional C-z is needed to undo stuff. 
Could be mildly annoying if it is (not sure it is...) but would
certainly acceptable to fix a crash.

> - when doing record undo, the math cell is stored as a string.
>   However, MathScriptInset::write omits empty scripts. I changed this
>   in the script, but I do not know whether there are bad side effects.

Saving a document is changed. Try a round trip with empty cells.
The potential of damage is low in any case as empty scripts
can be read back correctly. Might be even a good move in general.

>   An alternative would be to add a keepempty member to WriteStream,
>   which would be set to true when in asString.

Sounds more difficult and fragile.
 
> - the part in undo is not really related to the bug (it could be
>   omitted): it ensures that the cursor is set correctly after undoing
>   an recordUndoInset undo.

If it works ;-}

Andre'

Reply via email to