X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..439ddeba9dcb2bb020ba70da81dab76746dc0081:/src/generic/fontdlgg.cpp diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 40aed1a7dc..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,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();