Stefan Schimanski wrote:

Am 11.03.2008 um 11:48 schrieb Abdelrazak Younes:

Stefan Schimanski wrote:
Am 06.03.2008 um 22:34 schrieb Abdelrazak Younes:
Abdelrazak Younes wrote:
Stefan,
The way we do the macro tables update is not optimal and I think time consuming. I've cleaned up child document handling now except for everything macro related. I believe you can do all this stuff in updateLabels(), please have a look.

I had a closer look at the macro stuff. This is really complicated Stefan. WRT child/parent handling, I think you should take the same solution as for the labels and the toc backend, namely that only the _master_ macro table is updated and maintained. IOW, this means that the macro registering presently done in Buffer::updateEnvironmentMacros():
Please take a look at the two Buffer::updateMacros methods now after my commmit. I is _much_ simpler now. No mutual recursions anymore to get the scopes right for macro definitions inside font changes or environments. Probably there is even more room for simplification now with the new global semantics.

Yes, it is much simpler. Still, I think most (all?) of this code should go to the insets.

You mean the different cases in the updateMacros loop? Probably one can move some of it to the insets. Will look into this.

Just some hints and suggestion:

- I am not sure the children_positions cache is needed as you can retrieve the same information now thanks to toc_backend_["child"]. But if it is really needed for speed reason, I would let child documents register themselves in InsetInclude::updateLabels(), a new method "Buffer::setChild(Buffer &, DocIterator const &)" comes to mind.

- we need a new virtual method: Inset::updateMacros() implemented in InsetText and in MathMacroTemplate at least. I think I'd call InsetText::updateMacros() inside InsetText::updateLabels() for example.

- about updateMacroInstances(), I don't see why this is needed. Maybe you could just call updateMacros() inside InsetMathNest::addToToc().

Of course what this all means is that "updateLabels()" and "addToToc()" should probably renamed to "updateBufferContext()" and "realizeBufferContext()".

Abdel.

Reply via email to