]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/gdicmn.cpp
Fix another off-by-1 bug in wxMBConv::ToWChar().
[wxWidgets.git] / src / common / gdicmn.cpp
index e23c9a27fecbeabcf2e8dc505593aac0cea4c803..06117b98c239c3f16c74c0f5f21a9f6c57fe3125 100644 (file)
@@ -405,7 +405,7 @@ void wxColourDatabase::AddColour(const wxString& name, const wxColour& colour)
 
     // ... and we also allow both grey/gray
     wxString colNameAlt = colName;
 
     // ... and we also allow both grey/gray
     wxString colNameAlt = colName;
-    if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) )
+    if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) )
     {
         // but in this case it is not necessary so avoid extra search below
         colNameAlt.clear();
     {
         // but in this case it is not necessary so avoid extra search below
         colNameAlt.clear();
@@ -433,7 +433,7 @@ wxColour wxColourDatabase::Find(const wxString& colour) const
     wxString colName = colour;
     colName.MakeUpper();
     wxString colNameAlt = colName;
     wxString colName = colour;
     colName.MakeUpper();
     wxString colNameAlt = colName;
-    if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) )
+    if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) )
         colNameAlt.clear();
 
     wxStringToColourHashMap::iterator it = m_map->find(colName);
         colNameAlt.clear();
 
     wxStringToColourHashMap::iterator it = m_map->find(colName);
@@ -545,6 +545,9 @@ const wxBrush* wxStockGDI::GetBrush(Item item)
         case BRUSH_GREEN:
             brush = new wxBrush(*GetColour(COLOUR_GREEN), wxBRUSHSTYLE_SOLID);
             break;
         case BRUSH_GREEN:
             brush = new wxBrush(*GetColour(COLOUR_GREEN), wxBRUSHSTYLE_SOLID);
             break;
+        case BRUSH_YELLOW:
+            brush = new wxBrush(*GetColour(COLOUR_YELLOW), wxBRUSHSTYLE_SOLID);
+            break;
         case BRUSH_GREY:
             brush = new wxBrush(wxColour(wxT("GREY")), wxBRUSHSTYLE_SOLID);
             break;
         case BRUSH_GREY:
             brush = new wxBrush(wxColour(wxT("GREY")), wxBRUSHSTYLE_SOLID);
             break;
@@ -590,6 +593,9 @@ const wxColour* wxStockGDI::GetColour(Item item)
         case COLOUR_GREEN:
             colour = new wxColour(0, 255, 0);
             break;
         case COLOUR_GREEN:
             colour = new wxColour(0, 255, 0);
             break;
+        case COLOUR_YELLOW:
+            colour = new wxColour(255, 255, 0);
+            break;
         case COLOUR_LIGHTGREY:
             colour = new wxColour(wxT("LIGHT GREY"));
             break;
         case COLOUR_LIGHTGREY:
             colour = new wxColour(wxT("LIGHT GREY"));
             break;
@@ -671,12 +677,18 @@ const wxPen* wxStockGDI::GetPen(Item item)
         case PEN_BLACKDASHED:
             pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_SHORT_DASH);
             break;
         case PEN_BLACKDASHED:
             pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_SHORT_DASH);
             break;
+        case PEN_BLUE:
+            pen = new wxPen(*GetColour(COLOUR_BLUE), 1, wxPENSTYLE_SOLID);
+            break;
         case PEN_CYAN:
             pen = new wxPen(*GetColour(COLOUR_CYAN), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_GREEN:
             pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_CYAN:
             pen = new wxPen(*GetColour(COLOUR_CYAN), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_GREEN:
             pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxPENSTYLE_SOLID);
             break;
+        case PEN_YELLOW:
+            pen = new wxPen(*GetColour(COLOUR_YELLOW), 1, wxPENSTYLE_SOLID);
+            break;
         case PEN_GREY:
             pen = new wxPen(wxColour(wxT("GREY")), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_GREY:
             pen = new wxPen(wxColour(wxT("GREY")), 1, wxPENSTYLE_SOLID);
             break;
@@ -717,6 +729,8 @@ void wxDeleteStockLists()
     wxDELETE(wxTheBrushList);
     wxDELETE(wxThePenList);
     wxDELETE(wxTheFontList);
     wxDELETE(wxTheBrushList);
     wxDELETE(wxThePenList);
     wxDELETE(wxTheFontList);
+
+    // wxTheColourDatabase is cleaned up by wxAppBase::CleanUp()
 }
 
 // ============================================================================
 }
 
 // ============================================================================