We have code like:
int Paragraph::beginningOfBody() const
{
if (layout()->labeltype != LABEL_MANUAL)
return 0;
// Unroll the first two cycles of the loop
// and remember the previous character to
// remove unnecessary GetChar() calls
pos_type i = 0;
if (i < size() && getChar(i) != Paragraph::META_NEWLINE) {
++i;
char previous_char = 0;
char temp = 0;
if (i < size()
&& (previous_char = getChar(i)) != Paragraph::META_NEWLINE) {
// Yes, this ^ is supposed to be "= " not "=="
++i;
while (i < size()
&& previous_char != ' '
&& (temp = getChar(i)) != Paragraph::META_NEWLINE) {
++i;
previous_char = temp;
}
}
}
return i;
}
This is used only for the List and Description layouts and causes quite a
bit of messy code. The comments even seem to indicate that there is some
perfromance problem there.
What about using InsetOptArg or something similar for that purpose?
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)