X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2517b523979d4beaabbbe3538df1b49d682748d..e5544e77ecdf73269be6d3555b109407d0b9f62b:/src/msw/clipbrd.cpp diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 49cc833ca9..cd848901bd 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -87,11 +87,11 @@ // old-style clipboard functions using Windows API // --------------------------------------------------------------------------- -static bool gs_wxClipboardIsOpen = FALSE; +static bool gs_wxClipboardIsOpen = false; bool wxOpenClipboard() { - wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, wxT("clipboard already opened.") ); + wxCHECK_MSG( !gs_wxClipboardIsOpen, true, wxT("clipboard already opened.") ); wxWindow *win = wxTheApp->GetTopWindow(); if ( win ) @@ -107,24 +107,24 @@ bool wxOpenClipboard() { wxLogDebug(wxT("Can not open clipboard without a main window.")); - return FALSE; + return false; } } bool wxCloseClipboard() { - wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, wxT("clipboard is not opened") ); + wxCHECK_MSG( gs_wxClipboardIsOpen, false, wxT("clipboard is not opened") ); - gs_wxClipboardIsOpen = FALSE; + gs_wxClipboardIsOpen = false; if ( ::CloseClipboard() == 0 ) { wxLogSysError(_("Failed to close the clipboard.")); - return FALSE; + return false; } - return TRUE; + return true; } bool wxEmptyClipboard() @@ -133,10 +133,10 @@ bool wxEmptyClipboard() { wxLogSysError(_("Failed to empty the clipboard.")); - return FALSE; + return false; } - return TRUE; + return true; } bool wxIsClipboardOpened() @@ -151,7 +151,7 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) if ( ::IsClipboardFormatAvailable(cf) ) { // ok from the first try - return TRUE; + return true; } // for several standard formats, we can convert from some other ones too @@ -167,7 +167,7 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) #endif // wxUSE_ENH_METAFILE default: - return FALSE; + return false; } } @@ -196,7 +196,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, SelectObject(hdcSrc, old); DeleteDC(hdcMem); DeleteDC(hdcSrc); - return FALSE; + return false; } HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap); @@ -274,7 +274,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, default: { wxLogError(_("Unsupported clipboard format.")); - return FALSE; + return false; } case wxDF_OEMTEXT: @@ -306,15 +306,15 @@ bool wxSetClipboardData(wxDataFormat dataFormat, case wxDF_HTML: { char* html = (char *)data; - + // Create temporary buffer for HTML header... char *buf = new char [400 + strlen(html)]; - if(!buf) return FALSE; - + if(!buf) return false; + // Get clipboard id for HTML format... static int cfid = 0; if(!cfid) cfid = RegisterClipboardFormat(wxT("HTML Format")); - + // Create a template string for the HTML header... strcpy(buf, "Version:0.9\r\n" @@ -324,7 +324,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, "EndFragment:00000000\r\n" "\r\n" "\r\n"); - + // Append the HTML... strcat(buf, html); strcat(buf, "\r\n"); @@ -333,7 +333,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, "\r\n" "\r\n" ""); - + // Now go back, calculate all the lengths, and write out the // necessary header information. Note, wsprintf() truncates the // string when you overwrite it so you follow up with code to replace @@ -341,35 +341,35 @@ bool wxSetClipboardData(wxDataFormat dataFormat, char *ptr = strstr(buf, "StartHTML"); wsprintf(ptr+10, "%08u", strstr(buf, "") - buf); *(ptr+10+8) = '\r'; - + ptr = strstr(buf, "EndHTML"); wsprintf(ptr+8, "%08u", strlen(buf)); *(ptr+8+8) = '\r'; - + ptr = strstr(buf, "StartFragment"); wsprintf(ptr+14, "%08u", strstr(buf, "