MCPcopy Create free account
hub / github.com/KDE/kdiff3 / lastPosInLine

Method lastPosInLine

src/selection.cpp:42–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42qsizetype 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
67bool Selection::within(LineRef l, qsizetype p) const
68{

Callers 2

getTextLayoutForLineMethod · 0.80
deleteSelectionMethod · 0.80

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected