// Retrieve a buffer of cells.
wxString wxStyledTextCtrl::GetStyledText(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;
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();
// Retrieve a range of text.
wxString wxStyledTextCtrl::GetTextRange(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);