* src/paragraph.C: hfillExpansion(): rewrite loop for better understanding

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16567 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Michael Schmitt 2007-01-07 10:42:10 +00:00
parent 154ea92de6
commit 651606f633

View File

@ -1588,9 +1588,9 @@ bool Paragraph::hfillExpansion(Row const & row, pos_type pos) const
return false; return false;
} }
// expand at the beginning of a row only if it is the first row of a paragaph // expand at the beginning of a row only if it is the first row of a paragraph
if (pos == row.pos()) { if (pos == row.pos()) {
return row.pos() == 0; return pos == 0;
} }
// do not expand in some labels // do not expand in some labels
@ -1600,11 +1600,11 @@ bool Paragraph::hfillExpansion(Row const & row, pos_type pos) const
// if there is anything between the first char of the row and // if there is anything between the first char of the row and
// the specified position that is neither a newline nor an hfill, // the specified position that is neither a newline nor an hfill,
// the hfill will be expanded, otherwise it won't // the hfill will be expanded, otherwise it won't
pos_type i = row.pos(); for (pos_type i = row.pos(); i < pos; i++) {
while (i < pos && (isNewline(i) || isHfill(i))) { if (!isNewline(i) && !isHfill(i))
++i; return true;
} }
return i != pos; return false;
} }