X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/706465df1f0d5b356424cc0aeee6c21ac403999e..4c6fdc3503a732af708610ad8fd5ba43122d4d5d:/src/richtext/richtextformatdlg.cpp diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index d85249f47f..2ec7304c44 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -94,15 +94,14 @@ wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::ms_FormattingDial void wxRichTextFormattingDialog::Init() { - m_imageList = NULL; m_styleDefinition = NULL; m_styleSheet = NULL; m_object = NULL; + m_options = 0; } wxRichTextFormattingDialog::~wxRichTextFormattingDialog() { - delete m_imageList; delete m_styleDefinition; } @@ -110,6 +109,9 @@ bool wxRichTextFormattingDialog::Create(long flags, wxWindow* parent, const wxSt const wxPoint& pos, const wxSize& sz, long style) { SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY); +#ifdef __WXMAC__ + SetWindowVariant(wxWINDOW_VARIANT_SMALL); +#endif int resizeBorder = wxRESIZE_BORDER; @@ -143,13 +145,11 @@ bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTe } // Apply attributes to the object being edited, if any -bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* WXUNUSED(ctrl), int flags) +bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* ctrl, int flags) { if (GetObject()) { - wxRichTextParagraphLayoutBox* parentContainer = GetObject()->GetParentContainer(); - if (parentContainer) - parentContainer->SetStyle(GetObject(), m_attributes, flags); + ctrl->SetStyle(GetObject(), m_attributes, flags); return true; } else @@ -516,7 +516,7 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) font.SetPointSize( static_cast(size) ); } - if ( font.Ok() ) + if ( font.IsOk() ) { dc.SetFont(font); // Calculate vertical and horizontal centre @@ -553,7 +553,7 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog(wxWindow* win) { wxWindow* p = win->GetParent(); - while (p && !p->IsKindOf(CLASSINFO(wxRichTextFormattingDialog))) + while (p && !wxDynamicCast(p, wxRichTextFormattingDialog)) p = p->GetParent(); wxRichTextFormattingDialog* dialog = wxDynamicCast(p, wxRichTextFormattingDialog); return dialog; @@ -709,7 +709,7 @@ void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) if (event.LeftDown()) { wxWindow* parent = GetParent(); - while (parent != NULL && !parent->IsKindOf(CLASSINFO(wxDialog)) && !parent->IsKindOf(CLASSINFO(wxFrame))) + while (parent != NULL && !wxDynamicCast(parent, wxDialog) && !wxDynamicCast(parent, wxFrame)) parent = parent->GetParent(); wxColourData data; @@ -828,7 +828,7 @@ wxString wxRichTextFontListBox::CreateHTML(const wxString& facename) const if (!facename.IsEmpty() && facename != _("(none)")) str << wxT(" face=\"") << facename << wxT("\""); /* - if (def->GetStyle().GetTextColour().Ok()) + if (def->GetStyle().GetTextColour().IsOk()) str << wxT(" color=\"#") << ColourToHexString(def->GetStyle().GetTextColour()) << wxT("\""); */