]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/forty/scoredg.cpp
Fix unintialized pointer in wxCommandProcessor when
[wxWidgets.git] / demos / forty / scoredg.cpp
index fddbc0e3c4c783c8da222051df65544c7433714e..39f8f5eacb60df5c32b91e56836b51f314ca3b4c 100644 (file)
 #include "wx/wx.h"
 #endif
 
-#if wxUSE_IOSTREAMH
-#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__MWERKS__)
-#include <strstrea.h>
-#else
-#include <strstream.h>
-#endif
-#else
-#include <strstream>
-//using namespace std;
-#endif
 #include "scorefil.h"
 #include "scoredg.h"
 
@@ -66,9 +56,9 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) :
         wxArrayString players;
        scoreFile->GetPlayerList( players);
 
-       ostrstream os;
+       wxString os;
 
-       os << "Player\tWins\tGames\tScore\n";
+       os << wxT("Player\tWins\tGames\tScore\n");
        for (unsigned int i = 0; i < players.Count(); i++)
        {
                int wins, games, score;
@@ -79,15 +69,13 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) :
                        average = (2 * score + games) / (2 * games);
                }
 
-               os << players[i] << '\t' 
-                  << wins  << '\t'
-                  << games << '\t'
-                  << average << '\n';
+               os << players[i] << wxT('\t') 
+                  << wins  << wxT('\t')
+                  << games << wxT('\t')
+                  << average << wxT('\n');
        }
-       os << '\0';
-       char* str = os.str();
-       m_text = str;
-       delete str;
+       os << wxT('\0');
+       m_text = os;
 }
 
 ScoreCanvas::~ScoreCanvas()