On Sun, Apr 10, 2005 at 06:48:33PM +0200, Georg Baum wrote:
> Am Sonntag, 10. April 2005 16:22 schrieb Martin Vermeer:
> > On Sun, Apr 10, 2005 at 12:32:19PM +0200, Helge Hafting wrote:
> > > I wonder if this was the right approach - or would a special
> > > case in pasting be better?
> > > 
> > > Helge Hafting
> >  
> > I am afraid I must apologize for underestimating this. It required
> > considerably more doings to get it all right. The knobs and buttons were
> > all there, they just had to be found and put to use. This is actually
> > C++ at its best ;-9
> > 
> > I do believe that we should have "read" methods in all the insets to
> > replace the monolithic math parser. How to do that, is another question.
> 
> I would prefer that too, but this is _very_ difficult if not impossible as 
> long as math is stored as TeX. TeX is unparsable, even the subset we use 
> is difficult enough to parse. IMHO the current approach is not that bad.
> 
> > See patch.
> 
> Too confusing IMHO. I agree with Helge and would rather implement 
> MathRootInset::doDispatch() and handle LFUN_PASTE there. This is less 
> code duplication than with this patch.
> 
> 
> Georg
>

If you can do it more efficiently, why not. I don't like special casing,
but if you can do it in MathRootInset::doDispatch() it would even be
clean.

One reason I didn't consider this (not recognize what was meant,
actually) was my experience in implementing insert-around-selection for
font and deco insets (or general nestinsets), which I did in
LFUN_INSERT_MATH, not LFUN_PASTE. Actually why not implement an
LFUN_INSERT_MATH in MathRootInset? See math_nestinset.C for a role
model. (Note: cur.handleNest takes a second cell number arg, see
cursor.h!)

- Martin

Attachment: pgp9pvervE4bi.pgp
Description: PGP signature

Reply via email to