X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ad9ae3a29787f4cdf6dfc1c69d77fedfa2f4c73..708cc39462e4f113ab1a52b502b79d1e473059e7:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 0473d2f20e..621805fd25 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -3607,7 +3607,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style) wxArrayInt partialExtents; wxSize paraSize; - int paraDescent; + int paraDescent = 0; // This calculates the partial text extents GetRangeSize(GetRange(), paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_CACHE_SIZE, wxPoint(0,0), & partialExtents); @@ -6535,7 +6535,11 @@ bool wxRichTextBuffer::PasteFromClipboard(long position) delete richTextBuffer; } } - else if (wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT)) + else if (wxTheClipboard->IsSupported(wxDF_TEXT) +#if wxUSE_UNICODE + || wxTheClipboard->IsSupported(wxDF_UNICODETEXT) +#endif // wxUSE_UNICODE + ) { wxTextDataObject data; wxTheClipboard->GetData(data); @@ -6599,9 +6603,12 @@ bool wxRichTextBuffer::CanPasteFromClipboard() const #if wxUSE_CLIPBOARD && wxUSE_DATAOBJ if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open()) { - if (wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT) || - wxTheClipboard->IsSupported(wxDataFormat(wxRichTextBufferDataObject::GetRichTextBufferFormatId())) || - wxTheClipboard->IsSupported(wxDF_BITMAP)) + if (wxTheClipboard->IsSupported(wxDF_TEXT) +#if wxUSE_UNICODE + || wxTheClipboard->IsSupported(wxDF_UNICODETEXT) +#endif // wxUSE_UNICODE + || wxTheClipboard->IsSupported(wxDataFormat(wxRichTextBufferDataObject::GetRichTextBufferFormatId())) + || wxTheClipboard->IsSupported(wxDF_BITMAP)) { canPaste = true; } @@ -7837,7 +7844,7 @@ bool wxRichTextImageBlock::DoMakeImageBlock(const wxImage& image, wxBitmapType i unsigned char* block = new unsigned char[memStream.GetSize()]; if (!block) - return NULL; + return false; if (m_data) delete[] m_data;