From f99b00fabb4e1878b1da0c1471b7538cc0379169 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 11 Dec 2007 13:02:33 +0000 Subject: [PATCH] hack: don't use wxCharTypeBuffer::operator[]() as VC gives linking error for it for some reason git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/dcpsg.cpp | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 03f112f450..c7a349ce76 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -1342,11 +1342,9 @@ void wxPostScriptDCImpl::DoDrawText( const wxString& text, wxCoord x, wxCoord y PsPrint( buffer ); PsPrint( "(" ); - size_t len = strlen(textbuf); - size_t i; - for (i = 0; i < len; i++) + for ( const char *p = textbuf; *p != '\0'; p++ ) { - int c = (unsigned char) textbuf[i]; + int c = (unsigned char)*p; if (c == ')' || c == '(' || c == '\\') { /* Cope with special characters */ @@ -1450,26 +1448,27 @@ void wxPostScriptDCImpl::DoDrawRotatedText( const wxString& text, wxCoord x, wxC PsPrint( "(" ); const wxWX2MBbuf textbuf = text.mb_str(); - size_t len = strlen(textbuf); - size_t i; - for (i = 0; i < len; i++) + if ( textbuf ) { - int c = (unsigned char) textbuf[i]; - if (c == ')' || c == '(' || c == '\\') + for ( const char *p = textbuf; *p != '\0'; p++ ) { - /* Cope with special characters */ - PsPrint( "\\" ); - PsPrint( (char) c ); - } - else if ( c >= 128 ) - { - /* Cope with character codes > 127 */ - buffer.Printf( "\\%o", c); - PsPrint( buffer ); - } - else - { - PsPrint( (char) c ); + int c = (unsigned char)*p; + if (c == ')' || c == '(' || c == '\\') + { + /* Cope with special characters */ + PsPrint( "\\" ); + PsPrint( (char) c ); + } + else if ( c >= 128 ) + { + /* Cope with character codes > 127 */ + buffer.Printf( "\\%o", c); + PsPrint( buffer ); + } + else + { + PsPrint( (char) c ); + } } } -- 2.45.2