#endif
#include "wx/metafile.h"
+#include "wx/filename.h"
#if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH)
wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const
{
- return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data));
+ return new wxMetafileRefData(*static_cast<const wxMetafileRefData *>(data));
}
bool wxMetafile::SetClipboard(int width, int height)
return NULL;
}
-void wxMetafileDCImpl::SetMapMode(int mode)
+void wxMetafileDCImpl::SetMapMode(wxMappingMode mode)
{
m_mappingMode = mode;
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);