X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8de28db94f9d03acfcbbbac841c26a2c40223618..60df0f96859fb0131ddfa8b477612a15f4a43790:/contrib/src/stc/gen_iface.py diff --git a/contrib/src/stc/gen_iface.py b/contrib/src/stc/gen_iface.py index 04303b8202..4c7d15bcca 100644 --- a/contrib/src/stc/gen_iface.py +++ b/contrib/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);