Use wxSwap() function to swap values of variables
This commit is contained in:
@@ -150,9 +150,7 @@ methodOverrideMap = {
|
|||||||
'''wxMemoryBuffer %s(int startPos, int endPos) {
|
'''wxMemoryBuffer %s(int startPos, int endPos) {
|
||||||
wxMemoryBuffer buf;
|
wxMemoryBuffer buf;
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
int len = endPos - startPos;
|
int len = endPos - startPos;
|
||||||
if (!len) return buf;
|
if (!len) return buf;
|
||||||
@@ -615,9 +613,7 @@ methodOverrideMap = {
|
|||||||
Sci_RangeToFormat fr;
|
Sci_RangeToFormat fr;
|
||||||
|
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
fr.hdc = draw;
|
fr.hdc = draw;
|
||||||
fr.hdcTarget = target;
|
fr.hdcTarget = target;
|
||||||
@@ -676,9 +672,7 @@ methodOverrideMap = {
|
|||||||
|
|
||||||
'''wxString %s(int startPos, int endPos) {
|
'''wxString %s(int startPos, int endPos) {
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
int len = endPos - startPos;
|
int len = endPos - startPos;
|
||||||
if (!len) return wxEmptyString;
|
if (!len) return wxEmptyString;
|
||||||
|
@@ -369,9 +369,7 @@ void wxStyledTextCtrl::SetSavePoint()
|
|||||||
wxMemoryBuffer wxStyledTextCtrl::GetStyledText(int startPos, int endPos) {
|
wxMemoryBuffer wxStyledTextCtrl::GetStyledText(int startPos, int endPos) {
|
||||||
wxMemoryBuffer buf;
|
wxMemoryBuffer buf;
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
int len = endPos - startPos;
|
int len = endPos - startPos;
|
||||||
if (!len) return buf;
|
if (!len) return buf;
|
||||||
@@ -1728,9 +1726,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos, const wxString& text,
|
|||||||
Sci_RangeToFormat fr;
|
Sci_RangeToFormat fr;
|
||||||
|
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
fr.hdc = draw;
|
fr.hdc = draw;
|
||||||
fr.hdcTarget = target;
|
fr.hdcTarget = target;
|
||||||
@@ -1819,9 +1815,7 @@ wxString wxStyledTextCtrl::GetSelectedText() {
|
|||||||
// Retrieve a range of text.
|
// Retrieve a range of text.
|
||||||
wxString wxStyledTextCtrl::GetTextRange(int startPos, int endPos) {
|
wxString wxStyledTextCtrl::GetTextRange(int startPos, int endPos) {
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
int len = endPos - startPos;
|
int len = endPos - startPos;
|
||||||
if (!len) return wxEmptyString;
|
if (!len) return wxEmptyString;
|
||||||
@@ -5159,9 +5153,7 @@ wxCharBuffer wxStyledTextCtrl::GetTargetTextRaw()
|
|||||||
wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
|
wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
|
||||||
{
|
{
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
int len = endPos - startPos;
|
int len = endPos - startPos;
|
||||||
if (!len) {
|
if (!len) {
|
||||||
|
@@ -624,9 +624,7 @@ wxCharBuffer wxStyledTextCtrl::GetTargetTextRaw()
|
|||||||
wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
|
wxCharBuffer wxStyledTextCtrl::GetTextRangeRaw(int startPos, int endPos)
|
||||||
{
|
{
|
||||||
if (endPos < startPos) {
|
if (endPos < startPos) {
|
||||||
int temp = startPos;
|
wxSwap(startPos, endPos);
|
||||||
startPos = endPos;
|
|
||||||
endPos = temp;
|
|
||||||
}
|
}
|
||||||
int len = endPos - startPos;
|
int len = endPos - startPos;
|
||||||
if (!len) {
|
if (!len) {
|
||||||
|
Reference in New Issue
Block a user