* 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;
}
// 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()) {
return row.pos() == 0;
return pos == 0;
}
// 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
// the specified position that is neither a newline nor an hfill,
// the hfill will be expanded, otherwise it won't
pos_type i = row.pos();
while (i < pos && (isNewline(i) || isHfill(i))) {
++i;
for (pos_type i = row.pos(); i < pos; i++) {
if (!isNewline(i) && !isHfill(i))
return true;
}
return i != pos;
return false;
}