]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextstyledlg.cpp
Return an invalid item from wxDataViewCtrl::GetItemByRow() for invalid rows.
[wxWidgets.git] / src / richtext / richtextstyledlg.cpp
index 53419028269a298c2ed91be6c7b49806d625c2f0..f190e700e85b044f01dc9b9d94346874bd082edd 100644 (file)
@@ -152,6 +152,10 @@ bool wxRichTextStyleOrganiserDialog::Create( int flags, wxRichTextStyleSheet* sh
 
 void wxRichTextStyleOrganiserDialog::CreateControls()
 {
+#ifdef __WXMAC__
+    SetWindowVariant(wxWINDOW_VARIANT_SMALL);
+#endif
+
     bool hideTypeSelector = false;
     wxRichTextStyleListBox::wxRichTextStyleType typesToShow = wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL;
 
@@ -538,26 +542,15 @@ bool wxRichTextStyleOrganiserDialog::ApplyStyle(wxRichTextCtrl* ctrl)
         ctrl = GetRichTextCtrl();
     if (!ctrl)
         return false;
-    if (!ctrl->HasSelection())
-        return false;
-
 
     wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel);
     wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition);
-    wxRichTextBoxStyleDefinition* boxDef = wxDynamicCast(def, wxRichTextBoxStyleDefinition);
 
-    if (listDef && m_restartNumberingCtrl->GetValue())
+    if (listDef && m_restartNumberingCtrl->GetValue() && ctrl->HasSelection())
     {
         wxRichTextRange range = ctrl->GetSelectionRange();
         return ctrl->SetListStyle(range, listDef, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_RENUMBER);
     }
-    else if (boxDef)
-    {
-        if (!ctrl->GetFocusObject() || (ctrl->GetFocusObject() && (ctrl->GetFocusObject() == & ctrl->GetBuffer())))
-            return false;
-        ctrl->SetStyle(ctrl->GetFocusObject(), def->GetStyleMergedWithBase(m_stylesListBox->GetStyleSheet()));
-        return true;
-    }
     else
     {
         return ctrl->ApplyStyle(def);