On 07/11/2009 01:36, Andre Poenitz wrote:
On Fri, Nov 06, 2009 at 07:20:00PM -0500, rgheck wrote:
On 11/06/2009 06:35 PM, Enrico Forestieri wrote:
On Fri, Nov 06, 2009 at 04:50:17PM +0100, Abdelrazak Younes wrote:


Modified: lyx-devel/trunk/src/mathed/MathMacroTemplate.h
==============================================================================
+       MathMacroTemplate(Buffer * buf = 0);

   >   Modified: lyx-devel/trunk/src/mathed/MathParser.h
==============================================================================
   >   +bool mathed_parse_normal(MathAtom&, docstring const&,
   >   +             Parse::flags f = Parse::NORMAL, Buffer * buf = 0);

Why the default buf to 0? Shouldn't we enforce that?

In some parts of the code there is no way (that I know of) to get the
pointer to the buffer for which a MathHull inset is being created
(these are those corner cases I was speaking about). So what should
be the default? In those cases the buffer_ member is left 0, as it was
before this patch.


I worked through this once when trying to get the Inset constructor to
have to take a Buffer member, and ran into this same problem.

By now I wonder: does every inset know its "direct parent" at the time
of construction?

I am not sure about mathed but this change (pass the parent inset at construction instead of Buffer) would be easy to do for other insets. For mathed the convolution between MathData, MathArray and InsetMath complicates things a bit...
But I agree with you, that would be nice to have.

Abdel.

Andre'

Reply via email to