Index: trunk/BNC/src/bnchlpdlg.cpp
===================================================================
--- trunk/BNC/src/bnchlpdlg.cpp	(revision 10086)
+++ trunk/BNC/src/bnchlpdlg.cpp	(revision 10087)
@@ -41,5 +41,5 @@
 #include <QHBoxLayout>
 #include <QVBoxLayout>
-
+#include <iostream>
 #include "bnchlpdlg.h"
 #include "bnchtml.h"
@@ -140,4 +140,5 @@
 
   QString text = _what->text();
+
   Qt::CaseSensitivity cs = _cbCase->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive;
 
@@ -156,5 +157,4 @@
 void bncHlpDlg::slotFindNext(const QString& str, Qt::CaseSensitivity cs) {
   QString searchString = str;
-  bool found = false;
   QTextDocument::FindFlags flags;
   flags |= QTextDocument::FindWholeWords;
@@ -163,15 +163,11 @@
   }
 
-  if (!_hlCursor.atEnd()) {
-    _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
-    if (!_hlCursor.isNull()) {
-        found = true;
-        _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
-        _tb->setTextCursor(_hlCursor);
-    }
-  }
-
-  if (found == false) {
-    _hlCursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor);
+  _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
+  if (!_hlCursor.isNull()) {
+    _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
+    _tb->setTextCursor(_hlCursor);
+  }
+  else {
+    _hlCursor.movePosition(QTextCursor::Start);
     _tb->setTextCursor(_hlCursor);
   }
@@ -182,5 +178,4 @@
 void bncHlpDlg::slotFindPrev(const QString& str, Qt::CaseSensitivity cs) {
   QString searchString = str;
-  bool found = false;
   QTextDocument::FindFlags flags;
   flags |= QTextDocument::FindWholeWords;
@@ -190,21 +185,18 @@
   }
 
-  if (!_hlCursor.atEnd()) {
-    _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
-    if (!_hlCursor.isNull()) {
-        found = true;
-        _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
-        _tb->setTextCursor(_hlCursor);
-    }
-  }
-
-  if (found == false) {
-    _hlCursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor);
-    _tb->setTextCursor(_hlCursor);
-  }
-}
-
-
-
-
-
+  _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
+  if (!_hlCursor.isNull()) {
+    _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
+    _tb->setTextCursor(_hlCursor);
+  }
+  else {
+    _hlCursor.movePosition(QTextCursor::End);
+    _tb->setTextCursor(_hlCursor);
+  }
+
+}
+
+
+
+
+
