mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
* 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:
parent
154ea92de6
commit
651606f633
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user