X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/44cc96a80c09c8572e1315be66d29f6d610cbf78..194323c7c0c16222a1c05e2d7f7c507439d7260f:/src/richtext/richtextxml.cpp diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index a9833b3e74..e1d42d4647 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -200,6 +200,7 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node) if (!data.empty()) { wxRichTextImage* imageObj = new wxRichTextImage(para); + GetStyle(imageObj->GetAttributes(), child, false); para->AppendChild(imageObj); wxStringInputStream strStream(data); @@ -720,6 +721,8 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem, { wxRichTextImage& imageObj = (wxRichTextImage&) obj; + wxString style = CreateStyle(obj.GetAttributes(), false); + if (imageObj.GetImage().Ok() && !imageObj.GetImageBlock().Ok()) imageObj.MakeBlock(); @@ -728,11 +731,11 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem, if (!imageObj.GetImageBlock().Ok()) { // No data - OutputString(stream, wxT(">"), convMem, convFile); + OutputString(stream, style + wxT(">"), convMem, convFile); } else { - OutputString(stream, wxString::Format(wxT(" imagetype=\"%d\">"), (int) imageObj.GetImageBlock().GetImageType())); + OutputString(stream, wxString::Format(wxT(" imagetype=\"%d\"") + style + wxT(">"), (int) imageObj.GetImageBlock().GetImageType())); } OutputIndentation(stream, indent+1); @@ -1063,7 +1066,7 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttr& attr, wxXmlNode* node, bool isPa attr.SetTextColour(value); } - value = node->GetAttribute(wxT("backgroundcolor"), wxEmptyString); + value = node->GetAttribute(wxT("bgcolor"), wxEmptyString); if (!value.empty()) { if (value[0] == wxT('#'))