1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #4239

ezavod (1):
      fix: iterate all blocks
This commit is contained in:
Diadlo 2017-03-12 14:53:46 +03:00
commit d1ec8cc989
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -337,8 +337,10 @@ QString Text::extractSanitizedText(int from, int to) const
return "";
QString txt;
QTextBlock block = doc->firstBlock();
QTextBlock begin = doc->findBlock(from);
QTextBlock end = doc->findBlock(to);
for (QTextBlock block = begin; block != end.next() && block.isValid(); block = block.next()) {
for (QTextBlock::Iterator itr = block.begin(); itr != block.end(); ++itr) {
int pos =
itr.fragment()
@ -363,6 +365,11 @@ QString Text::extractSanitizedText(int from, int to) const
}
}
txt += '\n';
}
txt.chop(1);
return txt;
}