+ if (terminateTag)
+ OutputString(stream, wxT("</") + objectName + wxT(">"), convMem, convFile);
+
+ return true;
+}
+
+bool wxRichTextXMLHandler::ExportStyleDefinition(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextStyleDefinition* def, int level)
+{
+ wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(def, wxRichTextCharacterStyleDefinition);
+ wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(def, wxRichTextParagraphStyleDefinition);
+ wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition);
+
+ wxString baseStyle = def->GetBaseStyle();
+ wxString baseStyleProp;
+ if (!baseStyle.IsEmpty())
+ baseStyleProp = wxT(" basestyle=\"") + baseStyle + wxT("\"");
+
+ if (charDef)
+ {
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("<characterstyle") + baseStyleProp + wxT(">"), convMem, convFile);
+
+ level ++;
+
+ wxString style = CreateStyle(def->GetStyle(), false);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("<style ") + style + wxT(">"), convMem, convFile);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</style>"), convMem, convFile);
+
+ level --;
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</characterstyle>"), convMem, convFile);
+ }
+ else if (listDef)
+ {
+ OutputIndentation(stream, level);
+
+ if (!listDef->GetNextStyle().IsEmpty())
+ baseStyleProp << wxT(" basestyle=\"") << listDef->GetNextStyle() << wxT("\"");
+
+ OutputString(stream, wxT("<liststyle") + baseStyleProp + wxT(">"), convMem, convFile);
+
+ level ++;
+
+ wxString style = CreateStyle(def->GetStyle(), false);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("<style ") + style + wxT(">"), convMem, convFile);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</style>"), convMem, convFile);
+
+ int i;
+ for (i = 0; i < 10; i ++)
+ {
+ wxRichTextAttr* levelAttr = listDef->GetLevelAttributes(i);
+ if (levelAttr)
+ {
+ wxString style = CreateStyle(def->GetStyle(), false);
+ wxString levelStr = wxString::Format(wxT(" level=\"%d\" "), (i+1));
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("<style ") + levelStr + style + wxT(">"), convMem, convFile);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</style>"), convMem, convFile);
+ }
+ }
+
+ level --;
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</liststyle>"), convMem, convFile);
+ }
+ else if (paraDef)
+ {
+ OutputIndentation(stream, level);
+
+ if (!listDef->GetNextStyle().IsEmpty())
+ baseStyleProp << wxT(" basestyle=\"") << listDef->GetNextStyle() << wxT("\"");
+
+ OutputString(stream, wxT("<paragraphstyle") + baseStyleProp + wxT(">"), convMem, convFile);
+
+ level ++;
+
+ wxString style = CreateStyle(def->GetStyle(), false);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("<style ") + style + wxT(">"), convMem, convFile);
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</style>"), convMem, convFile);
+
+ level --;
+
+ OutputIndentation(stream, level);
+ OutputString(stream, wxT("</paragraphstyle>"), convMem, convFile);
+ }