- wxRichTextCharacterStyleDefinition* p = wxDynamicCast(sheet->GetCharacterStyle(i), wxRichTextCharacterStyleDefinition);
- if (p)
- m_basedOn->Append(p->GetName());
+ size_t i;
+ for (i = 0; i < sheet->GetParagraphStyleCount(); i++)
+ {
+ wxRichTextParagraphStyleDefinition* p = wxDynamicCast(sheet->GetParagraphStyle(i), wxRichTextParagraphStyleDefinition);
+ if (p)
+ m_basedOn->Append(p->GetName());
+ }
+ }
+ else
+ {
+ size_t i;
+ for (i = 0; i < sheet->GetCharacterStyleCount(); i++)
+ {
+ wxRichTextCharacterStyleDefinition* p = wxDynamicCast(sheet->GetCharacterStyle(i), wxRichTextCharacterStyleDefinition);
+ if (p)
+ m_basedOn->Append(p->GetName());
+ }