as convention, if a text range is (x, -1), it means from x to the end, so if to
was -1, set it to the last position
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -941,6 +941,9 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
|
||||
{
|
||||
wxTextCoord colStart, colEnd,
|
||||
lineStart, lineEnd;
|
||||
// as convention, if `to` equal -1, it means go to the last position
|
||||
if ( to == -1)
|
||||
to = GetLastPosition();
|
||||
|
||||
if ( (from > to) ||
|
||||
!PositionToXY(from, &colStart, &lineStart) ||
|
||||
|
Reference in New Issue
Block a user