From: Julian Smart Date: Sun, 16 Apr 2006 18:37:09 +0000 (+0000) Subject: Make an image block beore writing it, if there's no data in the block X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d5363f57fb8beb6638932cb2b02a69262ee60f82 Make an image block beore writing it, if there's no data in the block git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 9c98c0a17b..3f714632a4 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -3854,7 +3854,7 @@ bool wxRichTextBuffer::PasteFromClipboard(long position) wxTextDataObject data; wxTheClipboard->GetData(data); wxString text(data.GetText()); - text.Replace(_T("\r\n"), _T("\n")); + text.Replace(_T("\r\n"), _T("\n")); InsertTextWithUndo(position+1, text, GetRichTextCtrl()); diff --git a/src/richtext/richtexthtml.cpp b/src/richtext/richtexthtml.cpp index ccf818e371..9a01d9e656 100644 --- a/src/richtext/richtexthtml.cpp +++ b/src/richtext/richtexthtml.cpp @@ -122,6 +122,7 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& node2 = node2->GetNext(); } + str << wxT("\n"); //OutputParagraphFormatting(currentParaStyle, para->GetAttributes(), stream, false); } node = node->GetNext(); @@ -486,6 +487,9 @@ void wxRichTextHTMLHandler::Image_to_Base64(wxRichTextImage* image, wxOutputStre str << GetMimeType(image->GetImageBlock().GetImageType()); str << wxT(";base64,"); + if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) + image->MakeBlock(); + wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() ); str << data;