On Wed, Jan 25, 2006 at 12:53:50PM +1030, Beck, Andrew Thomas - BECAT001
wrote:
> I am working on a patch for 1.4pre to allow renaming of macro
> templates and modifying the number of arguments. It all works, except
> the case that a macro template has already been instantiated within
> the text. Specifically, I would like to grow the argument list as
> required. The most straight forward place to do this is in metrics(),
> however this is obviously dodgy because a) it's a const function b)
> although the metrics will change, it's probably not the intended
> function of this function
> 
> Anyway, changing cells_ in MathNestInset to mutable get's around a),
> but it's dodgy.  My other option is to create a non-const update()
> function for MathArray's & call that prior to calling metrics() in
> text.C. Given that this is a one off issue, it seems a bit wastefull
> to cycle through everything twice.  So, my question is, where is an
> appropriate place to resize the argument list of a MathMacro object
> when it's associated MathMacroTemplate has been modified -
> specifically the number of arguments?

Not in metrics. metrics is only there to compute and cache the size of
an inset.

Provide some 'changeArgs' function or something like that.

Andre'

Reply via email to