X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/837e57436a89516a5fa9f478f401e06bd872c17c..30760ce7e58df02af3308cd7de8bd7694e791b8d:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 5f8cc9d74d..cd94dce908 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -81,7 +81,7 @@ static bool gs_wxClipboardIsOpen = FALSE; bool wxOpenClipboard() { - wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, _T("clipboard already opened.") ); + wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, wxT("clipboard already opened.") ); wxWindow *win = wxTheApp->GetTopWindow(); if ( win ) @@ -95,7 +95,7 @@ bool wxOpenClipboard() } else { - wxLogDebug(_T("Can not open clipboard without a main window.")); + wxLogDebug(wxT("Can not open clipboard without a main window.")); return FALSE; } @@ -103,7 +103,7 @@ bool wxOpenClipboard() bool wxCloseClipboard() { - wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, _T("clipboard is not opened") ); + wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, wxT("clipboard is not opened") ); gs_wxClipboardIsOpen = FALSE; @@ -142,7 +142,8 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) #if wxUSE_DRAG_AND_DROP static bool wxSetClipboardData(wxDataObject *data) { - size_t size = data->GetDataSize(); + wxDataFormat format = data->GetPreferredFormat(); + size_t size = data->GetDataSize(format); HANDLE hGlobal = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, size); if ( !hGlobal ) { @@ -154,11 +155,10 @@ static bool wxSetClipboardData(wxDataObject *data) LPVOID lpGlobalMemory = ::GlobalLock(hGlobal); - data->GetDataHere(lpGlobalMemory); + data->GetDataHere(format, lpGlobalMemory); GlobalUnlock(hGlobal); - wxDataFormat format = data->GetPreferredFormat(); if ( !::SetClipboardData(format, hGlobal) ) { wxLogSysError(_("Failed to set clipboard data in format %s"), @@ -221,7 +221,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, wxBitmap *bitmap = (wxBitmap *)data; HBITMAP hBitmap = (HBITMAP)bitmap->GetHBITMAP(); // NULL palette means to use the system one - HANDLE hDIB = BitmapToDIB(hBitmap, (HPALETTE)NULL); + HANDLE hDIB = wxBitmapToDIB(hBitmap, (HPALETTE)NULL); handle = SetClipboardData(CF_DIB, hDIB); #endif break; @@ -470,10 +470,10 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( data, FALSE, _T("data is invalid") ); + wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); #if wxUSE_DRAG_AND_DROP - wxCHECK_MSG( wxIsClipboardOpened(), FALSE, _T("clipboard not open") ); + wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); wxDataFormat format = data->GetFormat(); @@ -527,7 +527,7 @@ bool wxClipboard::IsSupported( wxDataFormat format ) bool wxClipboard::GetData( wxDataObject *data ) { - wxCHECK_MSG( wxIsClipboardOpened(), FALSE, _T("clipboard not open") ); + wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); #if wxUSE_DRAG_AND_DROP wxDataFormat format = data->GetFormat();