| 607 | } |
| 608 | |
| 609 | LRESULT CLogView::OnDblClick(NMHDR* pnmh) |
| 610 | { |
| 611 | auto& nmhdr = *reinterpret_cast<NMITEMACTIVATE*>(pnmh); |
| 612 | |
| 613 | if (SubItemToColumn(nmhdr.iSubItem) != Column::Message || nmhdr.iItem < 0 || static_cast<size_t>(nmhdr.iItem) >= m_logLines.size()) |
| 614 | return 0; |
| 615 | |
| 616 | int nFit = GetTextIndex(nmhdr.iItem, nmhdr.ptAction.x); |
| 617 | auto text = TabsToSpaces(GetItemWText(nmhdr.iItem, ColumnToSubItem(Column::Message))); |
| 618 | |
| 619 | int begin = nFit; |
| 620 | while (begin > 0) |
| 621 | { |
| 622 | if (!iswordchar(text[begin - 1])) |
| 623 | break; |
| 624 | --begin; |
| 625 | } |
| 626 | int end = nFit; |
| 627 | while (end < static_cast<int>(text.size())) |
| 628 | { |
| 629 | if (!iswordchar(text[end])) |
| 630 | break; |
| 631 | ++end; |
| 632 | } |
| 633 | SetHighlightText(std::wstring(text.begin() + begin, text.begin() + end)); |
| 634 | return 0; |
| 635 | } |
| 636 | |
| 637 | LRESULT CLogView::OnItemChanged(NMHDR* pnmh) |
| 638 | { |
nothing calls this directly
no test coverage detected