]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/metafile.cpp
Added wxDataViewListIndexModel::RowsDeleted() and various related corrections
[wxWidgets.git] / src / msw / metafile.cpp
index 29c08d30f2aa5b71c3bb98bcb727baa7aac1ee1d..3076145d20bff433c6cabef2871df602bf515d73 100644 (file)
@@ -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;