X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c33522fca7cddc441a316f5b9fb50d7685435ba..dc813e6c7ef8a9a26c035b004b512e1aa1b0bf3f:/src/msw/metafile.cpp diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 96c4771f80..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) @@ -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);