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

Method within

src/selection.cpp:67–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67bool Selection::within(LineRef l, qsizetype p) const
68{
69 if(!firstLine.isValid())
70 return false;
71
72 LineRef l1 = firstLine;
73 LineRef l2 = lastLine;
74 qsizetype p1 = firstPos;
75 qsizetype p2 = lastPos;
76 if(l1 > l2)
77 {
78 std::swap(l1, l2);
79 std::swap(p1, p2);
80 }
81 if(l1 == l2 && p1 > p2)
82 {
83 std::swap(p1, p2);
84 }
85 if(l1 <= l && l <= l2)
86 {
87 if(l1 == l2)
88 return p >= p1 && p < p2;
89 if(l == l1)
90 return p >= p1;
91 if(l == l2)
92 return p < p2;
93 return true;
94 }
95 return false;
96}
97
98bool Selection::lineWithin(LineRef l) const
99{

Callers 3

getSelectionMethod · 0.80
writeLineMethod · 0.80
getSelectionMethod · 0.80

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected