| 527 | } |
| 528 | |
| 529 | std::vector<std::string> |
| 530 | MockEditorInterface::get_underlined_words( |
| 531 | int indicator_id) const { |
| 532 | auto doc = active_document(); |
| 533 | if (!doc) |
| 534 | return {}; |
| 535 | if (indicator_id >= static_cast<int>(doc->indicator_info.size())) |
| 536 | return {}; |
| 537 | auto &target = doc->indicator_info[indicator_id].set_for; |
| 538 | auto it = target.begin(), jt = target.begin(); |
| 539 | std::vector<std::string> result; |
| 540 | while (true) { |
| 541 | it = std::find(jt, target.end(), true); |
| 542 | if (it == target.end()) |
| 543 | return result; |
| 544 | jt = std::find(it, target.end(), false); |
| 545 | result.push_back(get_text_range(static_cast<TextPosition>(it - target.begin()), |
| 546 | static_cast<TextPosition>(jt - target.begin()))); |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | void MockEditorInterface::make_all_visible() { |
| 551 | auto doc = active_document(); |
no test coverage detected