diff options
author | Aapo Haapanen <aapo.haapanen@nokia.com> | 2011-09-22 12:50:50 (GMT) |
---|---|---|
committer | Aapo Haapanen <aapo.haapanen@nokia.com> | 2011-09-22 12:50:50 (GMT) |
commit | 055d68ce72a9cfbaffa5ac85314aff215e7a74c6 (patch) | |
tree | 13966b40bddd20e0bb315619d80942d33111c884 | |
parent | b0fbf9dae591dc839e14a087c1d69189e3fe9461 (diff) | |
download | Qt-055d68ce72a9cfbaffa5ac85314aff215e7a74c6.zip Qt-055d68ce72a9cfbaffa5ac85314aff215e7a74c6.tar.gz Qt-055d68ce72a9cfbaffa5ac85314aff215e7a74c6.tar.bz2 |
fix for QTBUG-18050: QXmlQuery crash
-rw-r--r-- | src/xmlpatterns/api/qxmlquery.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xmlpatterns/api/qxmlquery.cpp b/src/xmlpatterns/api/qxmlquery.cpp index e69fe50..4690a8d 100644 --- a/src/xmlpatterns/api/qxmlquery.cpp +++ b/src/xmlpatterns/api/qxmlquery.cpp @@ -988,7 +988,12 @@ bool setFocusHelper(QXmlQuery *const queryInstance, const QXmlItem focusItem(focusResult.next()); if(focusItem.isNull() || focusResult.hasError()) + { + /* The previous focus must be cleared in error situations. + * Otherwise the query may be left in an inconsistent state. */ + queryInstance->setFocus(QXmlItem()); return false; + } else { queryInstance->setFocus(focusItem); |