X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8de28db94f9d03acfcbbbac841c26a2c40223618..2e25e7b7629b9c362d1fc689b536032a35441b8c:/src/stc/gen_iface.py diff --git a/src/stc/gen_iface.py b/src/stc/gen_iface.py index 04303b8202..4c7d15bcca 100644 --- a/src/stc/gen_iface.py +++ b/src/stc/gen_iface.py @@ -86,6 +86,11 @@ methodOverrideMap = { '''wxString %s(int startPos, int endPos) { wxString text; + if (endPos < startPos) { + int temp = startPos; + startPos = endPos; + endPos = temp; + } int len = endPos - startPos; if (!len) return ""; TextRange tr; @@ -266,6 +271,11 @@ methodOverrideMap = { wxRect pageRect) { RangeToFormat fr; + if (endPos < startPos) { + int temp = startPos; + startPos = endPos; + endPos = temp; + } fr.hdc = draw; fr.hdcTarget = target; fr.rc.top = renderRect.GetTop(); @@ -324,6 +334,11 @@ methodOverrideMap = { '''wxString %s(int startPos, int endPos) { wxString text; + if (endPos < startPos) { + int temp = startPos; + startPos = endPos; + endPos = temp; + } int len = endPos - startPos; if (!len) return ""; char* buff = text.GetWriteBuf(len);