void wxTextCtrl::SetSelection(long from, long to)
{
+ if( to == -1 )
+ to = GetLastPosition();
+
XmTextSetSelection ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to,
(Time) 0);
}
const char * const passwd = value;
int len = value.length();
- len += strlen(cbs->text->ptr) + 1; // + new text (if any) + NUL
+ len += ( cbs->text->ptr ?
+ strlen(cbs->text->ptr) :
+ 0 ) + 1; // + new text (if any) + NUL
len -= cbs->endPos - cbs->startPos; // - text from affected region.
char * newS = new char [len];
*dest++ = *p++;
// Copy the text to be inserted).
- while (*insert)
- *dest++ = *insert++;
+ if (insert)
+ while (*insert)
+ *dest++ = *insert++;
// Finally, copy into newS any remaining text from passwd[endPos] on.
for (p = passwd + cbs->endPos; *p; )