Leuven, E. a écrit :
Use needsUpdateCounters. See text2.C for example.
i had a look at it and was wondering about the following
case LABEL_ITEMIZE:
setCounter(buf, it);
return false;
what happens in setCounter(,)?
It is misnamed (should be setLabel, I am working on that). This would
set the bullet depending on the depth of the current paragraph.
if needsUpdateCounters() only *checks* for the type of layout (and whether we
need a counter update) nothing should happen here right?
See above.
am i also right in thinking that i only need to updateCounters if the 2 pars
that i am swapping both contain a counter?
Yes you are right but you need nevertheless to call needsUpdateCounters
for ITEMIZE for example.
so i need to update counters if i swap 2 section headings or move up an
enumerate item, but not if i move down a section heading...
Indeed, I would call needsUpdateCounters on both paragraphs in order to
be on the safe side. See how I do it in text.C::BreakParagraph.
i am therefore wondering: do i need this setCounter() each time when i check
whether i need a counter update? and does it interfere with the swapping?
Not sure I understand your question. needsUpdateCounters should give you
enough information wether you need to call updateCounters or not.
Abdel.
thanks, edwin