X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/802e382ff1f4e700a7fafd5c8a400668c5959bbf..8b6cf9bf10a43343734d1bb22f2fae3ade2f4a67:/src/msw/metafile.cpp diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 29c08d30f2..3076145d20 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -94,6 +94,16 @@ wxMetafile::~wxMetafile() { } +wxGDIRefData *wxMetafile::CreateGDIRefData() const +{ + return new wxMetafileRefData; +} + +wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const +{ + return new wxMetafileRefData(wx_static_cast(wxMetafileRefData *, data)); +} + bool wxMetafile::SetClipboard(int width, int height) { #if !wxUSE_CLIPBOARD @@ -218,14 +228,13 @@ void wxMetafileDC::DoGetTextExtent(const wxString& string, if (!fontToUse) fontToUse = &m_font; - HDC dc = GetDC(NULL); + ScreenHDC dc; + SelectInHDC selFont(dc, GetHfontOf(*fontToUse)); SIZE sizeRect; TEXTMETRIC tm; ::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect); - GetTextMetrics(dc, &tm); - - ReleaseDC(NULL, dc); + ::GetTextMetrics(dc, &tm); if ( x ) *x = sizeRect.cx;