X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e0dbc8dd94d7ba16cb97cb050c9588db4c3a12f..88ef3a57a47f840adea9d38bc11cb30689a0838a:/contrib/src/ogl/oglmisc.cpp diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index 19976f0fbf..9904941314 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "misc.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -282,7 +278,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, i ++; } - delete widths; + delete[] widths; } // Centre a list of strings in the given box @@ -383,7 +379,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double // Make new lines into NULL strings at this point int i = 0; int j = 0; int len = text.Length(); - wxChar word[200]; word[0] = 0; + wxChar word[400]; word[0] = 0; bool end_word = false; bool new_line = false; while (i < len) { @@ -452,7 +448,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double wxString oldBuffer(buffer); wxString s = node->GetData(); - if (s.IsEmpty()) + if (s.empty()) { // FORCE NEW LINE if (buffer.Length() > 0) @@ -871,10 +867,12 @@ wxColour oglHexToColour(const wxString& hex) hex.Mid(0,2).ToLong(&r, 16); hex.Mid(2,2).ToLong(&g, 16); hex.Mid(4,2).ToLong(&b, 16); - return wxColour(r, g, b); + return wxColour((unsigned char)r, + (unsigned char)g, + (unsigned char)b); } else - return wxColour(0,0,0); + return *wxBLACK; } // RGB to 3-digit hex