X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2ce59e9bb71dbe7a01d96ec3df158e626aaa145..dc813e6c7ef8a9a26c035b004b512e1aa1b0bf3f:/src/msw/metafile.cpp?ds=inline diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 7152568160..1f5593027e 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -30,6 +30,7 @@ #endif #include "wx/metafile.h" +#include "wx/filename.h" #if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH) @@ -101,7 +102,7 @@ wxGDIRefData *wxMetafile::CreateGDIRefData() const wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data)); + return new wxMetafileRefData(*static_cast(data)); } bool wxMetafile::SetClipboard(int width, int height) @@ -274,7 +275,7 @@ wxMetafile *wxMetafileDCImpl::Close() return NULL; } -void wxMetafileDCImpl::SetMapMode(int mode) +void wxMetafileDCImpl::SetMapMode(wxMappingMode mode) { m_mappingMode = mode; @@ -392,9 +393,11 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i FILE *fd = wxFopen(filename.fn_str(), _T("rb")); if (!fd) return false; - wxChar tempFileBuf[256]; - wxGetTempFileName(wxT("mf"), tempFileBuf); - FILE *fHandle = wxFopen(wxFNCONV(tempFileBuf), _T("wb")); + wxString tempFileBuf = wxFileName::CreateTempFileName(wxT("mf")); + if (tempFileBuf.empty()) + return false; + + FILE *fHandle = wxFopen(tempFileBuf.fn_str(), _T("wb")); if (!fHandle) return false; fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);