]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtexthtml.cpp
native implementation of DoGetPixel()
[wxWidgets.git] / src / richtext / richtexthtml.cpp
index c6bdfe9def6f22a210054b5186151d7651c759a2..2c8694d0c73f04c7e9eeabc550fba3c58c58f4e2 100644 (file)
@@ -129,7 +129,7 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream&
                 }
 
                 wxRichTextImage* image = wxDynamicCast(obj, wxRichTextImage);
-                if( image && !image->IsEmpty())
+                if( image && (!image->IsEmpty() || image->GetImageBlock().GetData()))
                     WriteImage( image, stream );
 
                 node2 = node2->GetNext();
@@ -239,8 +239,9 @@ void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED(
                 int listType = TypeOfList(thisStyle, tag);
                 m_listTypes.Add(listType);
 
-                wxString align = GetAlignment(thisStyle);
-                str << wxString::Format(wxT("<p align=\"%s\">"), align.c_str());
+                // wxHTML needs an extra <p> before a list when using <p> ... </p> in previous paragraphs.
+                // TODO: pass a flag that indicates we're using wxHTML.
+                str << wxT("<p>\n");
 
                 str << tag;
             }
@@ -290,7 +291,7 @@ void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttr& WXUNUSED(cu
         stream << wxT("</td></tr></table></p>\n");
         m_inTable = false;
     }
-    else
+    else if (!thisStyle.HasBulletStyle())
         stream << wxT("</p>\n");
 }