From 31275102230179e40a0d00022c41fcc0782cbf26 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 5 Jun 2009 20:51:47 +0000 Subject: [PATCH] porting back important speed fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/textctrl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osx/carbon/textctrl.cpp b/src/osx/carbon/textctrl.cpp index cc998a68f9..57c315012a 100644 --- a/src/osx/carbon/textctrl.cpp +++ b/src/osx/carbon/textctrl.cpp @@ -1125,6 +1125,15 @@ long wxMacMLTEControl::GetLastPosition() const wxTextPos actualsize = 0 ; Handle theText ; +#if wxUSE_UNICODE + OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText, kTXNUnicodeTextData ); + // all done + if ( err == noErr ) + { + actualsize = GetHandleSize( theText )/sizeof(UniChar); + DisposeHandle( theText ) ; + } +#else OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText, kTXNTextData ); // all done @@ -1133,6 +1142,7 @@ long wxMacMLTEControl::GetLastPosition() const actualsize = GetHandleSize( theText ) ; DisposeHandle( theText ) ; } +#endif else { actualsize = 0 ;