]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/fontdlgg.cpp
Applied patch [ 851044 ] wxGrid receives wxFocusEvent
[wxWidgets.git] / src / generic / fontdlgg.cpp
index 0b0ed9a8421714549aca7aacd2139ba9c523ef0b..9ac0c7dcfa4034a28728e1653ef1f27e5b0bd04c 100644 (file)
@@ -329,12 +329,9 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
 {
   if (!m_useEvents) return;
 
-  int fontFamily = 0;  /* shut up buggy egcs warnings */
-  fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
-  int fontWeight = 0;
-  fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
-  int fontStyle = 0;
-  fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
+  int fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST familyChoice->GetStringSelection());
+  int fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
+  int fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
   int fontSize = wxAtoi(pointSizeChoice->GetStringSelection());
   int fontUnderline = underLineCheckBox->GetValue();
 
@@ -342,13 +339,11 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
   m_previewer->SetFont(dialogFont);
   if (colourChoice->GetStringSelection() != wxT(""))
   {
-    wxColour *col = (wxColour*) NULL;
-    col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
-    if (col)
+    wxColour col = wxTheColourDatabase->Find(colourChoice->GetStringSelection());
+    if (col.Ok())
     {
-      m_fontData.m_fontColour = *col;
-      m_previewer->SetForegroundColour(*col);
-      delete col;
+      m_fontData.m_fontColour = col;
+      m_previewer->SetForegroundColour(col);
     }
   }
   m_previewer->Refresh();