summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-05-08 09:42:16 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-05-08 08:00:03 +0000
commitffa1f9f870024be8fcc26f35a80924a3711dd615 (patch)
treeb1b58973d531b74131f434dc769d5693e76d0a35 /src/plugins/coreplugin
parent2187d444c14734fbec0ef4277bf63a9202f036a4 (diff)
downloadqt-creator-ffa1f9f870024be8fcc26f35a80924a3711dd615.tar.gz
App output filter: Try harder to detect an invalid text block
Calling QTextBlock::isValid() is not enough to ensure that the block is still part of the document. Fixes: QTCREATORBUG-22379 Change-Id: I3016e763b67f3983bdb9077c80ae3de8d46e4080 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r--src/plugins/coreplugin/outputwindow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp
index 7a85a251f0..077b6f406d 100644
--- a/src/plugins/coreplugin/outputwindow.cpp
+++ b/src/plugins/coreplugin/outputwindow.cpp
@@ -331,8 +331,10 @@ void OutputWindow::filterNewContent()
auto &lastBlock = d->lastFilteredBlock;
- if (!lastBlock.isValid())
+ if (!lastBlock.isValid() || lastBlock.blockNumber() >= document->blockCount()
+ || document->findBlockByNumber(lastBlock.blockNumber()) != lastBlock) {
lastBlock = document->begin();
+ }
if (d->filterMode.testFlag(OutputWindow::FilterModeFlag::RegExp)) {
QRegularExpression regExp(d->filterText);