Abdelrazak Younes a écrit :
Andre Poenitz a écrit :
I would rewrite this like this:
bool needEnumCounterReset(ParagraphList & pars, size_t const pos)
{
BOOST_ASSERT(pars[pos].layout()->labeltype == LABEL_ENUMERATE);
lyx::depth_type const cur_depth = pars[pos].getDepth();
for (size_t i = pos - 1; i != 0; ++i)
for (size_t i = pos - 1; i != 0; --i)
{
if (pars[i].getDepth() <= cur_depth)
return pars[i].layout()->labeltype !=
LABEL_ENUMERATE;
}
// start of nested inset: reset
return true;
}
Maybe I am missing something but this is simpler. Please correct me if I
am wrong.
Abdel.