I have been browsing through the code for about two hours now and I am
fairly confident that overall structure would improve quite a bit if
insets and paragraphs had direct access to their buffers. 

It would also lay the foundation to fix a few longstanding problems
in mathed: Conversion between the TeX string representation and the
inset structure is Buffer dependent due to macros, yet we simply ignore
the problem in those places where we don't have easy buffer access.

I really would like to give this a try.

A rough plan would be something like:

1. Have a Buffer * Inset::buffer_ member in all insets, set directly
after construction.

2. Make sure it sort-of-gets-adjusted on copy&paste.

3. Drop the buffer parameter from all 

4. Consolitdation.

5. Remove the buffer_ member from Inset and have such only in those
the actually use it (meaning especially no such member in
InsetMathChar)

6.-10. do similar for Paragraph.

For the Old Guard: this is slightly different to the inset owner, as the
buffer an inset belongs to is rarely changed, and only in a few places
(construction, cut&paste). So there's less 'maintanance', and for
ordinary operations, Paragraphs still have value semantics.

Note also that InsetTabular already has such a member, and other insets
need BufferParam argument at construction time.

Andre'

Reply via email to