| 40 | } |
| 41 | |
| 42 | qsizetype Selection::lastPosInLine(LineRef l) const |
| 43 | { |
| 44 | assert(firstLine.isValid()); |
| 45 | |
| 46 | LineRef l1 = firstLine; |
| 47 | LineRef l2 = lastLine; |
| 48 | qsizetype p1 = firstPos; |
| 49 | qsizetype p2 = lastPos; |
| 50 | |
| 51 | if(l1 > l2) |
| 52 | { |
| 53 | std::swap(l1, l2); |
| 54 | std::swap(p1, p2); |
| 55 | } |
| 56 | if(l1 == l2 && p1 > p2) |
| 57 | { |
| 58 | std::swap(p1, p2); |
| 59 | } |
| 60 | |
| 61 | if(l == l2) |
| 62 | return p2; |
| 63 | |
| 64 | return limits<qint32>::max(); |
| 65 | } |
| 66 | |
| 67 | bool Selection::within(LineRef l, qsizetype p) const |
| 68 | { |
no test coverage detected