]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/fontdlgg.cpp
removing unreached code (overriden)
[wxWidgets.git] / src / generic / fontdlgg.cpp
index 40aed1a7dcd95db8a4bf88c0218e743bf025c90f..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,12 +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);
+      m_fontData.m_fontColour = col;
+      m_previewer->SetForegroundColour(col);
     }
   }
   m_previewer->Refresh();