]> git.saurik.com Git - wxWidgets.git/commitdiff
Make an image block beore writing it, if there's no data in the block
authorJulian Smart <julian@anthemion.co.uk>
Sun, 16 Apr 2006 18:37:09 +0000 (18:37 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 16 Apr 2006 18:37:09 +0000 (18:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp
src/richtext/richtexthtml.cpp

index 9c98c0a17b8f70de22e1b66698b60622225edf9e..3f714632a4c7d42857426186adfb8ea5dc1faa8c 100644 (file)
@@ -3854,7 +3854,7 @@ bool wxRichTextBuffer::PasteFromClipboard(long position)
                 wxTextDataObject data;
                 wxTheClipboard->GetData(data);
                 wxString text(data.GetText());
                 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());
 
 
                 InsertTextWithUndo(position+1, text, GetRichTextCtrl());
 
index ccf818e371743139e788009ebb0b4d422e378180..9a01d9e656816aacf92893e33b6d92eb84e66a22 100644 (file)
@@ -122,6 +122,7 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream&
                 
                 node2 = node2->GetNext();
             }
                 
                 node2 = node2->GetNext();
             }
+            str << wxT("\n");
             //OutputParagraphFormatting(currentParaStyle, para->GetAttributes(), stream, false);
         }
         node = node->GetNext();
             //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,");
     
     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;
     
     wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() );
     str << data;