X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/603f702b4a0e19ffa27cffc52872efaac1aa8c54..abe0903cd4a16c6d8f50a3263d601fc718038c6d:/src/richtext/richtextformatdlg.cpp diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index c440a7736b..f7939da5a4 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -94,7 +94,6 @@ wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::ms_FormattingDial void wxRichTextFormattingDialog::Init() { - m_imageList = NULL; m_styleDefinition = NULL; m_styleSheet = NULL; m_object = NULL; @@ -102,7 +101,6 @@ void wxRichTextFormattingDialog::Init() wxRichTextFormattingDialog::~wxRichTextFormattingDialog() { - delete m_imageList; delete m_styleDefinition; } @@ -143,13 +141,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 WXUNUSED(flags)) { if (GetObject()) { - wxRichTextParagraphLayoutBox* parentContainer = GetObject()->GetParentContainer(); - if (parentContainer) - parentContainer->SetStyle(GetObject(), m_attributes, flags); + ctrl->SetStyle(GetObject(), m_attributes); return true; } else @@ -516,7 +512,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 @@ -594,7 +590,7 @@ wxRichTextStyleDefinition* wxRichTextFormattingDialog::GetDialogStyleDefinition( void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl, wxCheckBox* checkBox) { int unitsIdx = 0; - + if (!dim.IsValid()) { checkBox->SetValue(false); @@ -611,9 +607,14 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT if (dim.GetUnits() == wxTEXT_ATTR_UNITS_TENTHS_MM) { unitsIdx = 1; - float value = float(dim.GetValue()) / 10.0; + float value = float(dim.GetValue()) / 100.0; valueCtrl->SetValue(wxString::Format(wxT("%.2f"), value)); } + else if (dim.GetUnits() == wxTEXT_ATTR_UNITS_PERCENTAGE) + { + unitsIdx = 2; + valueCtrl->SetValue(wxString::Format(wxT("%d"), (int) dim.GetValue())); + } else { unitsIdx = 0; @@ -634,6 +635,8 @@ void wxRichTextFormattingDialog::GetDimensionValue(wxTextAttrDimension& dim, wxT { if (unitsCtrl->GetSelection() == 1) dim.SetUnits(wxTEXT_ATTR_UNITS_TENTHS_MM); + else if (unitsCtrl->GetSelection() == 2) + dim.SetUnits(wxTEXT_ATTR_UNITS_PERCENTAGE); else dim.SetUnits(wxTEXT_ATTR_UNITS_PIXELS); @@ -821,7 +824,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("\""); */