X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1696b86f89c2f990a7c708064c43f95aa99a5c8..f156e20c8e21594f901bfce15db4459208ec9571:/src/generic/fontdlgg.cpp diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 0b0ed9a842..9ac0c7dcfa 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -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();