mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
#7357 avoid an endless loop in countWords() when the "to" position is inside skipped text (e. g. note inset)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37940 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
07ef381914
commit
0afeabb969
@ -185,7 +185,7 @@ int countWords(DocIterator const & from, DocIterator const & to)
|
||||
int count = 0;
|
||||
bool inword = false;
|
||||
|
||||
for (DocIterator dit = from ; dit != to ; ) {
|
||||
for (DocIterator dit = from ; dit != to && !dit.empty(); ) {
|
||||
if (!dit.inTexted()) {
|
||||
dit.forwardPos();
|
||||
continue;
|
||||
@ -202,6 +202,8 @@ int countWords(DocIterator const & from, DocIterator const & to)
|
||||
if (ins && !ins->producesOutput()) {
|
||||
//skip this inset
|
||||
++dit.top().pos();
|
||||
if (dit >= to)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
if (par.isWordSeparator(pos))
|
||||
|
Loading…
Reference in New Issue
Block a user