On 01/28/2010 08:23 AM, Jürgen Spitzmüller wrote:
Abdelrazak Younes wrote:
How you do that seems to be a bit compilcated. If I follow the
InsetMathHull::draw() function I'd think you need the following
functions:

InsetMathHull::updateLabels(); calls
InsetMathGrid::updateLabels(); calls
MathData::updateLabels(); calls
MathAtom::(operator->)(updateLabels()) which is redirected to
InsetMath::updateLabels(), which is then probably only (non-trivially)
implemented for InsetMathRef.
That's fully correct.
Many thanks, guys, this worked.

Attached is a working patch that fixes bug 1560. Also, it fixed the bug that
MathRefs are not shown in the TOC (I didn't find a ticket for that).

I do not particularly like the InsetMathRef::changeTarget method, but I did
not find an easier way to simply change the content of cell(0) of the inset. I
learned that I manually had to set the buffer in this method; else, buffer_ is
0 afterwards.


Correct. The buffer is always reinitialzed on construction.


Anyone has an idea to improve that? If not, I'll commit.

It's not that terrible but I guess you could create a new method CommandInset::init() instead of this gymnastic with params and strings :-)

Another comment: you don't need a default implementation of updateLabel() in InsetMath.h, it's already in Inset.h

Abdel.


Reply via email to