| 628 | } |
| 629 | |
| 630 | void PatchHighlighter::clear() { |
| 631 | if( m_ranges.empty() ) |
| 632 | return; |
| 633 | |
| 634 | auto* const document = m_doc->textDocument(); |
| 635 | Q_ASSERT(document); |
| 636 | const auto lines = document->marks().keys(); |
| 637 | for (int line : lines) { |
| 638 | document->removeMark(line, m_allmarks); |
| 639 | } |
| 640 | |
| 641 | // Diff is taking care of its own objects (except removed ones) |
| 642 | qDeleteAll( m_ranges.keys() ); |
| 643 | m_ranges.clear(); |
| 644 | } |
| 645 | |
| 646 | PatchHighlighter::~PatchHighlighter() { |
| 647 | clear(); |
no test coverage detected