+/// Add a definition to the appropriate style list
+bool wxRichTextStyleSheet::AddStyle(wxRichTextStyleDefinition* def)
+{
+ wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition);
+ if (listDef)
+ return AddListStyle(listDef);
+
+ wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(def, wxRichTextParagraphStyleDefinition);
+ if (paraDef)
+ return AddParagraphStyle(paraDef);
+
+ wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(def, wxRichTextCharacterStyleDefinition);
+ if (charDef)
+ return AddCharacterStyle(charDef);
+
+ return false;
+}
+
+/// Find any definition by name
+wxRichTextStyleDefinition* wxRichTextStyleSheet::FindStyle(const wxString& name, bool recurse) const
+{
+ wxRichTextListStyleDefinition* listDef = FindListStyle(name, recurse);
+ if (listDef)
+ return listDef;
+
+ wxRichTextParagraphStyleDefinition* paraDef = FindParagraphStyle(name, recurse);
+ if (paraDef)
+ return paraDef;
+
+ wxRichTextCharacterStyleDefinition* charDef = FindCharacterStyle(name, recurse);
+ if (charDef)
+ return charDef;
+
+ return NULL;
+}
+