X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73597f8affdbf871f740aa7abb92affe657bf606..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/gtk/dataobj.cpp?ds=inline diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index dbe0952d50..c742b77f15 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -33,6 +33,7 @@ GdkAtom g_textAtom = 0; GdkAtom g_altTextAtom = 0; GdkAtom g_pngAtom = 0; GdkAtom g_fileAtom = 0; +GdkAtom g_htmlAtom = 0; //------------------------------------------------------------------------- // wxDataFormat @@ -95,6 +96,9 @@ void wxDataFormat::SetType( wxDataFormatId type ) if (m_type == wxDF_FILENAME) m_format = g_fileAtom; else + if (m_type == wxDF_HTML) + m_format = g_htmlAtom; + else { wxFAIL_MSG( wxT("invalid dataformat") ); } @@ -131,6 +135,9 @@ void wxDataFormat::SetId( NativeFormat format ) else if (m_format == g_fileAtom) m_type = wxDF_FILENAME; + else + if (m_format == g_htmlAtom) + m_type = wxDF_HTML; else m_type = wxDF_PRIVATE; } @@ -164,6 +171,8 @@ void wxDataFormat::PrepareFormats() g_pngAtom = gdk_atom_intern( "image/png", FALSE ); if (!g_fileAtom) g_fileAtom = gdk_atom_intern( "text/uri-list", FALSE ); + if (!g_htmlAtom) + g_htmlAtom = gdk_atom_intern( "text/html", FALSE ); } //------------------------------------------------------------------------- @@ -384,12 +393,12 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) m_bitmap = wxBitmap(image); - return m_bitmap.Ok(); + return m_bitmap.IsOk(); } void wxBitmapDataObject::DoConvertToPng() { - if ( !m_bitmap.Ok() ) + if ( !m_bitmap.IsOk() ) return; wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL,