Optimize wxTextCtrl::GetLastPosition() in wxOSX
To get the length of the text in the control there is no need to convert NSString to wxString (what is done now by calling to GetStringValue).
This commit is contained in:
@@ -845,6 +845,12 @@ void wxNSTextViewControl::SetEditable(bool editable)
|
||||
[m_textView setEditable: editable];
|
||||
}
|
||||
|
||||
long wxNSTextViewControl::GetLastPosition() const
|
||||
{
|
||||
wxCHECK( m_textView, 0 );
|
||||
return [[m_textView string] length];
|
||||
}
|
||||
|
||||
void wxNSTextViewControl::GetSelection( long* from, long* to) const
|
||||
{
|
||||
if (m_textView)
|
||||
@@ -1221,6 +1227,11 @@ void wxNSTextFieldControl::SetEditable(bool editable)
|
||||
[m_textField setEditable:editable];
|
||||
}
|
||||
|
||||
long wxNSTextFieldControl::GetLastPosition() const
|
||||
{
|
||||
return [[m_textField stringValue] length];
|
||||
}
|
||||
|
||||
void wxNSTextFieldControl::GetSelection( long* from, long* to) const
|
||||
{
|
||||
NSText* editor = [m_textField currentEditor];
|
||||
|
Reference in New Issue
Block a user