X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/521bf4ff3ef47059265beff5d53c9e1162beb122..04ab8b6ddfa26fbabeadad36966a21a42fe649b1:/src/msw/metafile.cpp diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 3032a5e2cd..5b3e574c4d 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -122,8 +122,6 @@ bool wxMetafile::Play(wxDC *dc) if (!m_refData) return false; - dc->BeginDrawing(); - if (dc->GetHDC() && M_METAFILEDATA->m_metafile) { if ( !::PlayMetaFile(GetHdcOf(*dc), (HMETAFILE) @@ -133,8 +131,6 @@ bool wxMetafile::Play(wxDC *dc) } } - dc->EndDrawing(); - return true; } @@ -193,9 +189,9 @@ wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, i m_minY = 10000; m_maxX = -10000; m_maxY = -10000; - if ( !file.empty() && wxFileExists(file)) + if ( !file.empty() && wxFileExists(file) ) wxRemoveFile(file); - m_hDC = (WXHDC) CreateMetaFile(file); + m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : file.c_str()); m_ok = true; @@ -214,11 +210,13 @@ wxMetafileDC::~wxMetafileDC() } void wxMetafileDC::GetTextExtent(const wxString& string, long *x, long *y, - long *descent, long *externalLeading, wxFont *theFont, bool WXUNUSED(use16bit)) const + long *descent, long *externalLeading, + const wxFont *theFont, + bool WXUNUSED(use16bit)) const { - wxFont *fontToUse = theFont; + const wxFont *fontToUse = theFont; if (!fontToUse) - fontToUse = (wxFont*) &m_font; + fontToUse = &m_font; HDC dc = GetDC(NULL);