X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c433798e64639df7669356b55ae6de110094dcf5..7735b2ea691f41d7a7f007befbe969386873b86e:/src/richtext/richtexthtml.cpp?ds=sidebyside diff --git a/src/richtext/richtexthtml.cpp b/src/richtext/richtexthtml.cpp index c6bdfe9def..0768034376 100644 --- a/src/richtext/richtexthtml.cpp +++ b/src/richtext/richtexthtml.cpp @@ -53,7 +53,7 @@ wxRichTextHTMLHandler::wxRichTextHTMLHandler(const wxString& name, const wxStrin bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const { wxString path, file, ext; - wxSplitPath(filename, & path, & file, & ext); + wxFileName::SplitPath(filename, & path, & file, & ext); return (ext.Lower() == wxT("html") || ext.Lower() == wxT("htm")); } @@ -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("
"), align.c_str()); + // wxHTML needs an extra
before a list when using
...
in previous paragraphs. + // TODO: pass a flag that indicates we're using wxHTML. + str << wxT("\n"); str << tag; } @@ -252,7 +253,12 @@ void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED( CloseLists(-1, str); wxString align = GetAlignment(thisStyle); - str << wxString::Format(wxT("
"), align.c_str()); + str << wxString::Format(wxT("
"); // Use a table int indentTenthsMM = thisStyle.GetLeftIndent() + thisStyle.GetLeftSubIndent(); @@ -275,7 +281,12 @@ void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED( CloseLists(-1, str); wxString align = GetAlignment(thisStyle); - str << wxString::Format(wxT("
"), align.c_str()); + str << wxString::Format(wxT("
"); } } @@ -290,7 +301,7 @@ void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttr& WXUNUSED(cu stream << wxT("
\n"); m_inTable = false; } - else + else if (!thisStyle.HasBulletStyle()) stream << wxT("\n"); }