Martin Vermeer a écrit :
On Sun, Apr 02, 2006 at 09:24:27AM +0200, Abdelrazak Younes wrote:
Hum no, not when the inset was following an enum list. I was calling
needEnumCounterReset with "buf.paragraphs()" instead of "it.plist". The
following patch is fixing this. If you want me to commit it, please
SHOUT. IMHO setCounter should be split up into self contained functions.
Hmmm, about the needEnumCounterReset stuff, I don't know. Is this really
saner?
I think yes. The ParagraphLists should be independent, there is
absolutely no reason to use a ParIterator here. I would like to go even
further. Indeed, I don't like at all the way the enumerate environment
inside an inset inherits the one of the mother inset. My patch is a
first step toward true independence. But I really like to know the
opinion of other so that I do not waste my time.
I find it somewhat more legible.
Come on, it is much more legible. The fact that a code is working is not
a reason for stopping any change to it.
About exiting setCounter for LABEL_NO_LABEL, I know that I proposed
this, but if you say it doesn't produce any noticable speedup, then
don't do this. Premature optimization attempt.
OK, I will try your other suggestion.
About correcting the for loop test, I'm pretty sure it is a simple
mistake. You should commit this if Jean-Marc agrees.
Let's wait then.
If you want to spend an entertaining sunday afternoon ;-), look at
breakParagraph in text.C, its "preserve_layout" variable, and how it is
transferred to breakParagraph in paragraph_funcs.C under the name
"flag". Note in particular its lack of documentation and its "int" nature
rather than a more legible enum (or even strings: "keep", "env",
"no")
It's too late for me already and I had a headache just with a first
glance at the code ;-)
I suspect you should look at the stuff underneath the comment
// layout stays the same with latex-environments
in paragraph_funcs.C. This code could certainly do with some
sanitization/clarification...
Indeed. There are a lot of code in LyX but I have the feeling that the
maintainers just want to stay with that. I am not interested to fix that
code by using the same style. But I would be interested in reorganizing
it using OO. In ten years maybe.
2) At depth 4, weird thing are happening (with or without my patch):
there's a message at the console "step: Counter does not exist: enum"
and the counters following are sometimes reset.
Which document class is this?
UserGuide.lyx, book style I think.
Thanks,
Abdel.