wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(def, wxRichTextCharacterStyleDefinition);
if (charDef)
return AddCharacterStyle(charDef);
-
+
return false;
}
wxRichTextCharacterStyleDefinition* charDef = FindCharacterStyle(name, recurse);
if (charDef)
return charDef;
-
- return NULL;
+
+ return NULL;
}
/// Copy
wxRichTextListStyleDefinition* def = (wxRichTextListStyleDefinition*) node->GetData();
AddListStyle(new wxRichTextListStyleDefinition(*def));
}
-
+
SetName(sheet.GetName());
SetDescription(sheet.GetDescription());
}
{
if (!GetStyleSheet())
return NULL;
-
- if (i >= m_styleNames.GetCount() || i < 0)
+
+ if (i >= m_styleNames.GetCount() /* || i < 0 */ )
return NULL;
return GetStyleSheet()->FindStyle(m_styleNames[i]);
if (GetStyleSheet())
{
SetSelection(wxNOT_FOUND);
-
+
m_styleNames.Clear();
-
+
size_t i;
if (GetStyleType() == wxRICHTEXT_STYLE_ALL || GetStyleType() == wxRICHTEXT_STYLE_PARAGRAPH)
{
for (i = 0; i < GetStyleSheet()->GetListStyleCount(); i++)
m_styleNames.Add(GetStyleSheet()->GetListStyle(i)->GetName());
}
-
+
m_styleNames.Sort();
SetItemCount(m_styleNames.GetCount());
wxString str;
bool isCentred = false;
-
+
wxRichTextAttr attr(def->GetStyleMergedWithBase(GetStyleSheet()));
if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
if (isCentred)
str << wxT("<center>");
-
+
str << wxT("<table><tr>");
if (attr.GetLeftIndent() > 0)
// Take into account current default style just chosen by user
if (ctrl->IsDefaultStyleShowing())
{
+ wxTextAttrEx attr;
+
+ ctrl->GetStyle(adjustedCaretPos, attr);
+ wxRichTextApplyStyle(attr, ctrl->GetDefaultStyleEx());
+
if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) &&
- !ctrl->GetDefaultStyleEx().GetCharacterStyleName().IsEmpty())
- styleName = ctrl->GetDefaultStyleEx().GetCharacterStyleName();
+ !attr.GetCharacterStyleName().IsEmpty())
+ styleName = attr.GetCharacterStyleName();
else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_PARAGRAPH) &&
- !ctrl->GetDefaultStyleEx().GetParagraphStyleName().IsEmpty())
- styleName = ctrl->GetDefaultStyleEx().GetParagraphStyleName();
+ !attr.GetParagraphStyleName().IsEmpty())
+ styleName = attr.GetParagraphStyleName();
else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_LIST) &&
- !ctrl->GetDefaultStyleEx().GetListStyleName().IsEmpty())
- styleName = ctrl->GetDefaultStyleEx().GetListStyleName();
+ !attr.GetListStyleName().IsEmpty())
+ styleName = attr.GetListStyleName();
}
else if (obj && (styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) &&
!obj->GetAttributes().GetCharacterStyleName().IsEmpty())