| 592 | } |
| 593 | |
| 594 | void BaseGrid::SetColumnWidths() { |
| 595 | int w, h; |
| 596 | GetClientSize(&w, &h); |
| 597 | |
| 598 | // DC for text extents test |
| 599 | wxClientDC dc(this); |
| 600 | dc.SetFont(font); |
| 601 | |
| 602 | text_refresh_rects.clear(); |
| 603 | int x = 0; |
| 604 | |
| 605 | if (!width_helper) |
| 606 | width_helper = std::make_unique<WidthHelper>(); |
| 607 | width_helper->SetDC(&dc); |
| 608 | |
| 609 | for (auto const& column : columns) { |
| 610 | column->UpdateWidth(context, *width_helper); |
| 611 | if (column->Width() && column->RefreshOnTextChange()) |
| 612 | text_refresh_rects.emplace_back(x, 0, column->Width(), h); |
| 613 | x += column->Width(); |
| 614 | } |
| 615 | width_helper->Age(); |
| 616 | } |
| 617 | |
| 618 | AssDialogue *BaseGrid::GetDialogue(int n) const { |
| 619 | if (static_cast<size_t>(n) >= index_line_map.size()) return nullptr; |
nothing calls this directly
no test coverage detected