Selection start is gauranteed to return the smaller of the two positions
Closes #1373
This commit is contained in:
parent
faf107a4ef
commit
5e3313d8a5
@ -2372,12 +2372,7 @@ pair<int, int> ScintillaEditView::getSelectionLinesRange() const
|
||||
|
||||
range.first = execute(SCI_LINEFROMPOSITION, start);
|
||||
range.second = execute(SCI_LINEFROMPOSITION, end);
|
||||
if (range.first > range.second)
|
||||
{
|
||||
int temp = range.first;
|
||||
range.first = range.second;
|
||||
range.second = temp;
|
||||
}
|
||||
|
||||
return range;
|
||||
}
|
||||
|
||||
@ -2448,7 +2443,7 @@ void ScintillaEditView::convertSelectedTextTo(bool Case)
|
||||
size_t selectionStart = execute(SCI_GETSELECTIONSTART);
|
||||
size_t selectionEnd = execute(SCI_GETSELECTIONEND);
|
||||
|
||||
int strSize = ((selectionEnd > selectionStart)?(selectionEnd - selectionStart):(selectionStart - selectionEnd))+1;
|
||||
int strSize = (selectionEnd - selectionStart) + 1;
|
||||
if (strSize)
|
||||
{
|
||||
char *selectedStr = new char[strSize+1];
|
||||
|
@ -466,11 +466,11 @@ public:
|
||||
return false;
|
||||
long start = long(execute(SCI_GETSELECTIONSTART));
|
||||
long end = long(execute(SCI_GETSELECTIONEND));
|
||||
selByte = (start < end)?end-start:start-end;
|
||||
selByte = end - start;
|
||||
|
||||
start = long(execute(SCI_LINEFROMPOSITION, start));
|
||||
end = long(execute(SCI_LINEFROMPOSITION, end));
|
||||
selLine = (start < end)?end-start:start-end;
|
||||
selLine = end - start;
|
||||
if (selLine)
|
||||
++selLine;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user