Changeset 10087 in ntrip


Ignore:
Timestamp:
Jun 9, 2023, 2:08:42 PM (10 months ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnchlpdlg.cpp

    r10082 r10087  
    4141#include <QHBoxLayout>
    4242#include <QVBoxLayout>
    43 
     43#include <iostream>
    4444#include "bnchlpdlg.h"
    4545#include "bnchtml.h"
     
    140140
    141141  QString text = _what->text();
     142
    142143  Qt::CaseSensitivity cs = _cbCase->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive;
    143144
     
    156157void bncHlpDlg::slotFindNext(const QString& str, Qt::CaseSensitivity cs) {
    157158  QString searchString = str;
    158   bool found = false;
    159159  QTextDocument::FindFlags flags;
    160160  flags |= QTextDocument::FindWholeWords;
     
    163163  }
    164164
    165   if (!_hlCursor.atEnd()) {
    166     _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
    167     if (!_hlCursor.isNull()) {
    168         found = true;
    169         _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
    170         _tb->setTextCursor(_hlCursor);
    171     }
    172   }
    173 
    174   if (found == false) {
    175     _hlCursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor);
     165  _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
     166  if (!_hlCursor.isNull()) {
     167    _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
     168    _tb->setTextCursor(_hlCursor);
     169  }
     170  else {
     171    _hlCursor.movePosition(QTextCursor::Start);
    176172    _tb->setTextCursor(_hlCursor);
    177173  }
     
    182178void bncHlpDlg::slotFindPrev(const QString& str, Qt::CaseSensitivity cs) {
    183179  QString searchString = str;
    184   bool found = false;
    185180  QTextDocument::FindFlags flags;
    186181  flags |= QTextDocument::FindWholeWords;
     
    190185  }
    191186
    192   if (!_hlCursor.atEnd()) {
    193     _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
    194     if (!_hlCursor.isNull()) {
    195         found = true;
    196         _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
    197         _tb->setTextCursor(_hlCursor);
    198     }
    199   }
    200 
    201   if (found == false) {
    202     _hlCursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor);
    203     _tb->setTextCursor(_hlCursor);
    204   }
    205 }
    206 
    207 
    208 
    209 
    210 
     187  _hlCursor = (_tb->document()->find(searchString, _hlCursor, flags));
     188  if (!_hlCursor.isNull()) {
     189    _hlCursor.movePosition(QTextCursor::WordRight, QTextCursor::KeepAnchor);
     190    _tb->setTextCursor(_hlCursor);
     191  }
     192  else {
     193    _hlCursor.movePosition(QTextCursor::End);
     194    _tb->setTextCursor(_hlCursor);
     195  }
     196
     197}
     198
     199
     200
     201
     202
Note: See TracChangeset for help on using the changeset viewer.