Corrected XML conversion in style names and face names

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2011-04-04 17:56:53 +00:00
parent b3169c12bc
commit 326c0adbfc

View File

@ -949,17 +949,17 @@ bool wxRichTextXMLHandler::ExportStyleDefinition(wxOutputStream& stream, wxRichT
wxString name = def->GetName(); wxString name = def->GetName();
wxString nameProp; wxString nameProp;
if (!name.empty()) if (!name.empty())
nameProp = wxT(" name=\"") + name + wxT("\""); nameProp = wxT(" name=\"") + AttributeToXML(name) + wxT("\"");
wxString baseStyle = def->GetBaseStyle(); wxString baseStyle = def->GetBaseStyle();
wxString baseStyleProp; wxString baseStyleProp;
if (!baseStyle.empty()) if (!baseStyle.empty())
baseStyleProp = wxT(" basestyle=\"") + baseStyle + wxT("\""); baseStyleProp = wxT(" basestyle=\"") + AttributeToXML(baseStyle) + wxT("\"");
wxString descr = def->GetDescription(); wxString descr = def->GetDescription();
wxString descrProp; wxString descrProp;
if (!descr.empty()) if (!descr.empty())
descrProp = wxT(" description=\"") + descr + wxT("\""); descrProp = wxT(" description=\"") + AttributeToXML(descr) + wxT("\"");
if (charDef) if (charDef)
{ {
@ -986,7 +986,7 @@ bool wxRichTextXMLHandler::ExportStyleDefinition(wxOutputStream& stream, wxRichT
OutputIndentation(stream, level); OutputIndentation(stream, level);
if (!listDef->GetNextStyle().empty()) if (!listDef->GetNextStyle().empty())
baseStyleProp << wxT(" nextstyle=\"") << listDef->GetNextStyle() << wxT("\""); baseStyleProp << wxT(" nextstyle=\"") << AttributeToXML(listDef->GetNextStyle()) << wxT("\"");
OutputString(stream, wxT("<liststyle") + nameProp + baseStyleProp + descrProp + wxT(">")); OutputString(stream, wxT("<liststyle") + nameProp + baseStyleProp + descrProp + wxT(">"));
@ -1027,7 +1027,7 @@ bool wxRichTextXMLHandler::ExportStyleDefinition(wxOutputStream& stream, wxRichT
OutputIndentation(stream, level); OutputIndentation(stream, level);
if (!paraDef->GetNextStyle().empty()) if (!paraDef->GetNextStyle().empty())
baseStyleProp << wxT(" nextstyle=\"") << paraDef->GetNextStyle() << wxT("\""); baseStyleProp << wxT(" nextstyle=\"") << AttributeToXML(paraDef->GetNextStyle()) << wxT("\"");
OutputString(stream, wxT("<paragraphstyle") + nameProp + baseStyleProp + descrProp + wxT(">")); OutputString(stream, wxT("<paragraphstyle") + nameProp + baseStyleProp + descrProp + wxT(">"));
@ -1098,7 +1098,7 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is
AddAttribute(str, wxT("fontunderlined"), (int) attr.GetFontUnderlined()); AddAttribute(str, wxT("fontunderlined"), (int) attr.GetFontUnderlined());
if (attr.HasFontFaceName()) if (attr.HasFontFaceName())
AddAttribute(str, wxT("fontface"), attr.GetFontFaceName()); AddAttribute(str, wxT("fontface"), AttributeToXML(attr.GetFontFaceName()));
if (attr.HasTextEffects()) if (attr.HasTextEffects())
{ {
@ -1107,7 +1107,7 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is
} }
if (!attr.GetCharacterStyleName().empty()) if (!attr.GetCharacterStyleName().empty())
AddAttribute(str, wxT("characterstyle"), attr.GetCharacterStyleName()); AddAttribute(str, wxT("characterstyle"), AttributeToXML(attr.GetCharacterStyleName()));
if (attr.HasURL()) if (attr.HasURL())
AddAttribute(str, wxT("url"), AttributeToXML(attr.GetURL())); AddAttribute(str, wxT("url"), AttributeToXML(attr.GetURL()));
@ -1148,19 +1148,19 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is
if (!attr.GetBulletText().empty() && (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL)) if (!attr.GetBulletText().empty() && (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL))
AddAttribute(str, wxT("bulletsymbol"), (int) (attr.GetBulletText()[0])); AddAttribute(str, wxT("bulletsymbol"), (int) (attr.GetBulletText()[0]));
else else
AddAttribute(str, wxT("bullettext"), attr.GetBulletText()); AddAttribute(str, wxT("bullettext"), AttributeToXML(attr.GetBulletText()));
AddAttribute(str, wxT("bulletfont"), attr.GetBulletFont()); AddAttribute(str, wxT("bulletfont"), attr.GetBulletFont());
} }
if (attr.HasBulletName()) if (attr.HasBulletName())
AddAttribute(str, wxT("bulletname"), attr.GetBulletName()); AddAttribute(str, wxT("bulletname"), AttributeToXML(attr.GetBulletName()));
if (!attr.GetParagraphStyleName().empty()) if (!attr.GetParagraphStyleName().empty())
AddAttribute(str, wxT("parstyle"), attr.GetParagraphStyleName()); AddAttribute(str, wxT("parstyle"), AttributeToXML(attr.GetParagraphStyleName()));
if (!attr.GetListStyleName().empty()) if (!attr.GetListStyleName().empty())
AddAttribute(str, wxT("liststyle"), attr.GetListStyleName()); AddAttribute(str, wxT("liststyle"), AttributeToXML(attr.GetListStyleName()));
if (attr.HasTabs()) if (attr.HasTabs())
{ {