From d97ab52d8c2a6671e850b4ea28e99efd117e1d0e Mon Sep 17 00:00:00 2001 From: nowrep Date: Fri, 27 Jul 2012 18:55:55 +0200 Subject: [PATCH] Fixed clearing highlight when search text not found. closes #479 --- src/lib/webview/searchtoolbar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/webview/searchtoolbar.cpp b/src/lib/webview/searchtoolbar.cpp index 01b5d37b3..6db016859 100644 --- a/src/lib/webview/searchtoolbar.cpp +++ b/src/lib/webview/searchtoolbar.cpp @@ -117,6 +117,7 @@ void SearchToolBar::searchText(const QString &text) { WebView* view = p_QupZilla->weView(); bool found = view->findText(text, m_findFlags); + if (text.isEmpty()) { found = true; } @@ -125,9 +126,13 @@ void SearchToolBar::searchText(const QString &text) m_findFlags = QWebPage::HighlightAllOccurrences; updateFindFlags(); view->findText(text, m_findFlags); + + if (!found) { + view->findText(QString(), QWebPage::HighlightAllOccurrences); + } } else { - view->findText("", QWebPage::HighlightAllOccurrences); + view->findText(QString(), QWebPage::HighlightAllOccurrences); } if (!found) {