first phase of transition to unified Unicode build:
1. changed c_str() to return wxCStrData (implicitly convertible to wxChar*) 2. added template type-safe wrappers for vararg functions 3. added wxUniChar class representing single Unicode character 4. changed wxString::operator[] and wxString::iterator to return wxUniChar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -606,9 +606,9 @@ void wxDCBase::DrawLabel(const wxString& text,
|
||||
|
||||
// split the string into lines and draw each of them separately
|
||||
wxString curLine;
|
||||
for ( const wxChar *pc = text; ; pc++ )
|
||||
for ( wxString::const_iterator pc = text.begin(); ; ++pc )
|
||||
{
|
||||
if ( *pc == _T('\n') || *pc == _T('\0') )
|
||||
if ( *pc == _T('\n') || pc == text.end() )
|
||||
{
|
||||
int xRealStart = x; // init it here to avoid compielr warnings
|
||||
|
||||
@@ -646,14 +646,14 @@ void wxDCBase::DrawLabel(const wxString& text,
|
||||
endUnderscore += xRealStart;
|
||||
}
|
||||
|
||||
if ( *pc == _T('\0') )
|
||||
if ( pc == text.end() )
|
||||
break;
|
||||
|
||||
curLine.clear();
|
||||
}
|
||||
else // not end of line
|
||||
{
|
||||
if ( pc - text.c_str() == indexAccel )
|
||||
if ( pc - text.begin() == indexAccel )
|
||||
{
|
||||
// remeber to draw underscore here
|
||||
GetTextExtent(curLine, &startUnderscore, NULL);
|
||||
|
||||
Reference in New Issue
Block a user