On 04/24/2011 06:02 AM, Edwin Leuven wrote:
Richard Heck<rgh...@comcast.net>:
What the usual calls to updateBuffer() do is always
make the macro context a ParIterator that points to
the first paragraph in the current inset. (See e.g.
the calls at InsetText:682,695.)
ok. makes me wonder though why it is necessary to set the macro
context explicitly.

I have wondered this too, but I ran into this same sort of problem in the XHTML output routine in InsetMathHull. To make the preview image, I needed a DocIterator pointing right at that inset. This is not something it seems to be easy to construct on the fly, so I had to arrange for the information to be cached, in effect, via the recordLocation() routine. I think the macro context must be similar.

So I'm attaching a few patches:

1. updateBuffer.diff solves the general problem mentioned.
2. x2a.patch is what seems to be a working version of x2.patch.
3. x3a.diff, which is a version of x3.patch that fixes the
problem in the
old code.

I'm not sure what I prefer here, but (1) seems necessary no
matter what. I
guess (3) is more cautious, and if there aren't other issues
for which (2)
is needed, maybe that's what makes sense.
the main difference between (2) and (3) is the label updating in updateBuffer?

And all the other things updateBuffer does, though it's not doing them properly here, since e.g. any counters wouldn't be properly set. This probably doesn't matter for LaTeX export, but it does mean that none of these strategies would work reliably for XHTML export. The difference is that, in the LaTeX case, we do not rely much upon these sorts of internal settings, whereas we very much do in the other case.

i am working on my document with (1) + (3) here, and have encountered
no problems so far

OK. Let's wait until Monday and see if anyone else has any input. I guess you and I are agreed on (3).

thanks for helping out with the tricky stuff

Of course.

Richard

Reply via email to