]> git.saurik.com Git - wxWidgets.git/commitdiff
Image objects should load and save attributes
authorJulian Smart <julian@anthemion.co.uk>
Fri, 25 Jan 2008 12:10:43 +0000 (12:10 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 25 Jan 2008 12:10:43 +0000 (12:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextxml.cpp

index d169ed227395a5b08b8994219d8dd10604ce7a3e..e1d42d4647337c52d5bbb4aef327039ee3ce9a15 100644 (file)
@@ -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);