On 12/02/2010 10:52 AM, Vincent van Ravesteijn wrote:
On Thu, Dec 2, 2010 at 4:48 PM, Jean-Marc Lasgouttes<lasgout...@lyx.org>  wrote:
Le 2 déc. 2010 à 16:19, Richard Heck a écrit :
The point here is that the old line completely wipes out the counters, 
including all record of which counters
there are but, in this case, most importantly, it doesn't reset the 
layout_stack_.
You hid a layout stack in counters?
That looks bad at first sight.

It's a stack of pointers to layouts (cheaper than names thereof). It's used in the calculation of counter values, which we use (now) only while preparing for XHTML output. (It would be fairly easy to extend it so that InsetRefs could display the values of the counters, as well as their labels. I've had that working.) We have to keep track of which layout we are in. Just keeping track of the last layout won't work, because of things like depth changes. So we stack them up.

Even worse: there are traces of html in the counter update code:

bool const save_layouts = utype == OutputUpdate&&  il.htmlisblock();

Probably htmlisblock() is misnamed, though we do only use it now with XHTML output. (And the first test is true only in that case.) It means: Is this inset is "inline", in the sense that its contents are out of the flow of the text? Branches are "inline" in this sense; footnotes are not. That has to do with saving and restoring the layout we're coming out of.

Richard

Reply via email to