]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextxml.cpp
remove unnecessary ?: operator
[wxWidgets.git] / src / richtext / richtextxml.cpp
index a9833b3e7437414cac5c5c52a083fba788659322..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);
@@ -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('#'))