Use wxSwap() function to swap values of variables

This commit is contained in:
Artur Wieczorek
2017-03-15 21:02:23 +01:00
parent 0cc5b6e97e
commit 3ec5e06dff
3 changed files with 8 additions and 24 deletions

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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) {