From bbbc85e52f0f0cc66fdf6b63511a6716099a1816 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 20 Jun 2023 21:11:44 +0100 Subject: [PATCH] Use wxClipboard instead of obsolete functions in wxMetafile Just call wxClipboard::SetData() instead of using obsolete functions for working with clipboard. This shouldn't result in any changes in behaviour. --- src/msw/metafile.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 654700ce08..5563ccd7b0 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -109,18 +109,7 @@ bool wxMetafile::SetClipboard(int width, int height) if (!m_refData) return false; - bool alreadyOpen = wxClipboardOpen(); - if (!alreadyOpen) - { - wxOpenClipboard(); - if (!wxEmptyClipboard()) - return false; - } - bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height); - if (!alreadyOpen) - wxCloseClipboard(); - - return success; + return wxTheClipboard->SetData(new wxMetafileDataObject(*this)); #endif }