X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e0dbc8dd94d7ba16cb97cb050c9588db4c3a12f..3285ee538be44537a0d4e43252db18f5e7362782:/contrib/src/ogl/oglmisc.cpp?ds=sidebyside diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index 19976f0fbf..bedff9915d 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -282,7 +282,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, i ++; } - delete widths; + delete[] widths; } // Centre a list of strings in the given box @@ -383,7 +383,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 +452,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 +871,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