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