X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30bf76303915c3d70e0ff9a180a48a2f80b8cd11..88b497c1291889313a82541267dfeac5ab13d06b:/src/richtext/richtextfontpage.cpp diff --git a/src/richtext/richtextfontpage.cpp b/src/richtext/richtextfontpage.cpp index eccebbcced..87a3fb7830 100644 --- a/src/richtext/richtextfontpage.cpp +++ b/src/richtext/richtextfontpage.cpp @@ -314,11 +314,11 @@ bool wxRichTextFontPage::TransferDataFromWindow() if (m_styleCtrl->GetSelection() != wxNOT_FOUND) { - int style; + wxFontStyle style; if (m_styleCtrl->GetStringSelection() == _("Italic")) - style = wxITALIC; + style = wxFONTSTYLE_ITALIC; else - style = wxNORMAL; + style = wxFONTSTYLE_NORMAL; attr->SetFontStyle(style); } @@ -327,11 +327,11 @@ bool wxRichTextFontPage::TransferDataFromWindow() if (m_weightCtrl->GetSelection() != wxNOT_FOUND) { - int weight; + wxFontWeight weight; if (m_weightCtrl->GetStringSelection() == _("Bold")) - weight = wxBOLD; + weight = wxFONTWEIGHT_BOLD; else - weight = wxNORMAL; + weight = wxFONTWEIGHT_NORMAL; attr->SetFontWeight(weight); } @@ -392,8 +392,9 @@ bool wxRichTextFontPage::TransferDataFromWindow() } else { - attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUBSCRIPT | wxTEXT_ATTR_EFFECT_SUPERSCRIPT ); - attr->SetTextEffects(attr->GetTextEffects() & ~( wxTEXT_ATTR_EFFECT_SUPERSCRIPT | wxTEXT_ATTR_EFFECT_SUBSCRIPT)); + // If they are undetermined, we don't want to include these flags in the text effects - the objects + // should retain their original style. + attr->SetTextEffectFlags(attr->GetTextEffectFlags() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT|wxTEXT_ATTR_EFFECT_SUPERSCRIPT) ); } return true; @@ -514,16 +515,16 @@ bool wxRichTextFontPage::TransferDataToWindow() } else { - m_superscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); - m_subscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); + m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); + m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); } } else { m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED); m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED); - m_superscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); - m_subscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); + m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); + m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); } UpdatePreview(); @@ -790,8 +791,9 @@ void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent& WXUNUSED(event) ) void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent& WXUNUSED(event) ) { - if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED && m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED ) + if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED) m_subscriptCtrl->Set3StateValue( wxCHK_UNCHECKED ); + UpdatePreview(); } @@ -801,7 +803,8 @@ void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent& WXU void wxRichTextFontPage::OnRichtextfontpageSubscriptClick( wxCommandEvent& WXUNUSED(event) ) { - if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED && m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED ) + if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED) m_superscriptCtrl->Set3StateValue( wxCHK_UNCHECKED ); + UpdatePreview(); }