diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-05-08 09:42:16 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-05-08 08:00:03 +0000 |
commit | ffa1f9f870024be8fcc26f35a80924a3711dd615 (patch) | |
tree | b1b58973d531b74131f434dc769d5693e76d0a35 /src/plugins/coreplugin | |
parent | 2187d444c14734fbec0ef4277bf63a9202f036a4 (diff) | |
download | qt-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.cpp | 4 |
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); |