- wxTextAttr charStyle(para->GetCombinedAttributes(obj->GetAttributes()));
- BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
-
- wxString text = textObj->GetText();
-
- if (charStyle.HasTextEffects() && (charStyle.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
- text.MakeUpper();
-
- wxString toReplace = wxRichTextLineBreakChar;
- text.Replace(toReplace, wxT("<br>"));
-
- str << text;
-
- EndCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
+ wxRichTextObject* obj = node2->GetData();
+ wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText);
+ if (textObj && !textObj->IsEmpty())
+ {
+ wxTextAttr charStyle(para->GetCombinedAttributes(obj->GetAttributes()));
+ BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
+
+ wxString text = textObj->GetText();
+
+ if (charStyle.HasTextEffects() && (charStyle.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
+ text.MakeUpper();
+
+ wxString toReplace = wxRichTextLineBreakChar;
+ text.Replace(toReplace, wxT("<br>"));
+
+ str << text;
+
+ EndCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
+ }
+
+ wxRichTextImage* image = wxDynamicCast(obj, wxRichTextImage);
+ if( image && (!image->IsEmpty() || image->GetImageBlock().GetData()))
+ WriteImage( image, stream );
+
+ node2 = node2->GetNext();