| 502 | } |
| 503 | |
| 504 | void DiffTextWindow::setFirstLine(LineRef firstLine) |
| 505 | { |
| 506 | qint32 fontHeight = fontMetrics().lineSpacing(); |
| 507 | |
| 508 | LineRef newFirstLine = std::max<LineRef>(0, firstLine); |
| 509 | |
| 510 | qint32 deltaY = fontHeight * (d->m_firstLine - newFirstLine); |
| 511 | |
| 512 | d->m_firstLine = newFirstLine; |
| 513 | |
| 514 | if(d->m_bSelectionInProgress && d->m_selection.isValidFirstLine()) |
| 515 | { |
| 516 | LineRef line; |
| 517 | qint32 pos; |
| 518 | convertToLinePos(d->m_lastKnownMousePos.x(), d->m_lastKnownMousePos.y(), line, pos); |
| 519 | d->m_selection.end(line, pos); |
| 520 | update(); |
| 521 | } |
| 522 | else |
| 523 | { |
| 524 | scroll(0, deltaY); |
| 525 | } |
| 526 | |
| 527 | Q_EMIT firstLineChanged(d->m_firstLine); |
| 528 | } |
| 529 | |
| 530 | LineRef DiffTextWindow::getFirstLine() const |
| 531 | { |
nothing calls this directly
no test coverage detected