From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 10 Dec 2000 00:24:06 +0000 (+0000)
Subject: merged in the fix for printing \% on PS DC
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2d5e89e1cdea2bdd2cbc0d0b58d5189473038e5e?ds=sidebyside

merged in the fix for printing \% on PS DC


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp
index 0db195a934..d471943452 100644
--- a/src/generic/dcpsg.cpp
+++ b/src/generic/dcpsg.cpp
@@ -1226,10 +1226,6 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
     wxCoord by = y + size - text_descent; // baseline
     fprintf( m_pstream, "%d %d moveto\n", XLOG2DEV(x), YLOG2DEV(by) );
 
-    /* I don't know how to write char to a stream, so I use a mini string */
-    char tmpbuf[2];
-    tmpbuf[1] = 0;
-
     fprintf( m_pstream, "(" );
     const wxWX2MBbuf textbuf = text.mb_str();
     int len = strlen(textbuf);
@@ -1241,8 +1237,7 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
         {
             /* Cope with special characters */
             fprintf( m_pstream, "\\" );
-            tmpbuf[0] = (char) c;
-            fprintf( m_pstream, tmpbuf );
+            fputc(c, m_pstream);
         }
         else if ( c >= 128 )
         {
@@ -1251,8 +1246,7 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
         }
         else
         {
-            tmpbuf[0] = (char) c;
-            fprintf( m_pstream, tmpbuf );
+            fputc(c, m_pstream);
         }
     }
 
@@ -1349,10 +1343,6 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
         if (buffer[i] == ',') buffer[i] = '.';
     fprintf(m_pstream, buffer);
 
-    /* I don't know how to write char to a stream, so I use a mini string */
-    char tmpbuf[2];
-    tmpbuf[1] = 0;
-
     fprintf( m_pstream, "(" );
     const wxWX2MBbuf textbuf = text.mb_str();
     int len = strlen(textbuf);
@@ -1363,8 +1353,7 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
         {
             /* Cope with special characters */
             fprintf( m_pstream, "\\" );
-            tmpbuf[0] = (char) c;
-            fprintf( m_pstream, tmpbuf );
+            fputc(c, m_pstream);
         }
         else if ( c >= 128 )
         {
@@ -1373,8 +1362,7 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
         }
         else
         {
-            tmpbuf[0] = (char) c;
-            fprintf( m_pstream, tmpbuf );
+            fputc(c, m_pstream);
         }
     }