1. PositionToXY() off-by-2 (!) bug corrected
2. controls sample dumps info about text control when F1 is pressed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -435,7 +435,7 @@ long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
||||
{
|
||||
wxString text = GetValue();
|
||||
|
||||
// cast to prevent warning. But pos really should've been unsigned.
|
||||
// cast to prevent warning. But pos really should've been unsigned.
|
||||
if( (unsigned long)pos > text.Len() )
|
||||
return FALSE;
|
||||
|
||||
@@ -445,8 +445,8 @@ long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
||||
if (pos == 0)
|
||||
return TRUE;
|
||||
|
||||
const char* stop = text.c_str() + pos + 1;
|
||||
for ( const char *p = text.c_str(); p <= stop; p++ )
|
||||
const char* stop = text.c_str() + pos;
|
||||
for ( const char *p = text.c_str(); p < stop; p++ )
|
||||
{
|
||||
if (*p == '\n')
|
||||
{
|
||||
|
Reference in New Issue
Block a user