X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1aca9fcdfc51f165210a9976f28afb192bfb252f..71a09c3579dd5cb4cd8fa7fdc143561cbff74e12:/src/richtext/richtextxml.cpp diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index fa3ee081c3..2243f7c936 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 2005-09-30 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -1092,8 +1091,10 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk()) AddAttribute(str, wxT("bgcolor"), attr.GetBackgroundColour()); - if (attr.HasFontSize()) - AddAttribute(str, wxT("fontsize"), attr.GetFontSize()); + if (attr.HasFontPointSize()) + AddAttribute(str, wxT("fontpointsize"), attr.GetFontSize()); + else if (attr.HasFontPixelSize()) + AddAttribute(str, wxT("fontpixelsize"), attr.GetFontSize()); if (attr.HasFontFamily()) AddAttribute(str, wxT("fontfamily"), attr.GetFontFamily()); @@ -1395,8 +1396,10 @@ bool wxRichTextXMLHandler::AddAttributes(wxXmlNode* node, wxRichTextAttr& attr, if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk()) node->AddAttribute(wxT("bgcolor"), MakeString(attr.GetBackgroundColour())); - if (attr.HasFontSize()) - node->AddAttribute(wxT("fontsize"), MakeString(attr.GetFontSize())); + if (attr.HasFontPointSize()) + node->AddAttribute(wxT("fontpointsize"), MakeString(attr.GetFontSize())); + else if (attr.HasFontPixelSize()) + node->AddAttribute(wxT("fontpixelsize"), MakeString(attr.GetFontSize())); if (attr.HasFontFamily()) node->AddAttribute(wxT("fontfamily"), MakeString(attr.GetFontFamily())); if (attr.HasFontItalic()) @@ -1683,10 +1686,15 @@ bool wxRichTextXMLHandler::ImportStyle(wxRichTextAttr& attr, wxXmlNode* node, bo if (!value.empty()) attr.SetFontStyle((wxFontStyle)wxAtoi(value)); } - else if (name == wxT("fontsize")) + else if (name == wxT("fontsize") || name == wxT("fontpointsize")) { if (!value.empty()) - attr.SetFontSize(wxAtoi(value)); + attr.SetFontPointSize(wxAtoi(value)); + } + else if (name == wxT("fontpixelsize")) + { + if (!value.empty()) + attr.SetFontPixelSize(wxAtoi(value)); } else if (name == wxT("fontweight")) {