| 1576 | } |
| 1577 | |
| 1578 | bool CLogView::Find(const std::string& text, int direction) |
| 1579 | { |
| 1580 | StopTracking(); |
| 1581 | |
| 1582 | int line = FindLine([text, this](const LogLine& line) { return Contains(m_logFile[line.line].text, text); }, direction); |
| 1583 | if (line < 0) |
| 1584 | return false; |
| 1585 | |
| 1586 | bool sameLine = GetItemState(line, LVIS_FOCUSED) != 0; |
| 1587 | if (!sameLine) |
| 1588 | ScrollToIndex(line, true); |
| 1589 | |
| 1590 | auto wtext = WStr(text).str(); |
| 1591 | if (sameLine && wtext == m_highlightText) |
| 1592 | return false; |
| 1593 | |
| 1594 | SetHighlightText(wtext); |
| 1595 | return true; |
| 1596 | } |
| 1597 | |
| 1598 | bool CLogView::FindNext(const std::wstring& text) |
| 1599 | { |