]> git.saurik.com Git - wxWidgets.git/commitdiff
merged in the fix for printing \% on PS DC
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Dec 2000 00:24:06 +0000 (00:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Dec 2000 00:24:06 +0000 (00:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dcpsg.cpp

index 0db195a9343453efffcd1df8b1d70e08166fdc54..d471943452cef25aec9332ba8b688e7ecaac2eb5 100644 (file)
@@ -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);
         }
     }