X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e306597309a120f2ae91385c731a5cb2722c52aa..b4a2ab728bf4627ab2b41385b69e31f10c1fd3b1:/src/msw/metafile.cpp diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 4a7b28900f..72bf474c32 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -72,7 +72,7 @@ wxMetafile::wxMetafile(const wxString& file) M_METAFILEDATA->m_windowsMappingMode = wxMM_ANISOTROPIC; M_METAFILEDATA->m_metafile = 0; - if (!file.IsNull() && (file.Cmp("") == 0)) + if (!file.IsNull() && (file.Cmp(T("")) == 0)) M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file); } @@ -146,7 +146,7 @@ wxMetafileDC::wxMetafileDC(const wxString& file) if (!file.IsNull() && wxFileExists(file)) wxRemoveFile(file); - if (!file.IsNull() && (file != "")) + if (!file.IsNull() && (file != T(""))) m_hDC = (WXHDC) CreateMetaFile(file); else m_hDC = (WXHDC) CreateMetaFile(NULL); @@ -167,7 +167,7 @@ wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, i m_minY = 10000; m_maxX = -10000; m_maxY = -10000; - if (file != "" && wxFileExists(file)) wxRemoveFile(file); + if (file != T("") && wxFileExists(file)) wxRemoveFile(file); m_hDC = (WXHDC) CreateMetaFile(file); m_ok = TRUE; @@ -197,15 +197,19 @@ void wxMetafileDC::GetTextExtent(const wxString& string, long *x, long *y, SIZE sizeRect; TEXTMETRIC tm; - GetTextExtentPoint(dc, (char *)(const char *) string, strlen((char *)(const char *) string), &sizeRect); + GetTextExtentPoint(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect); GetTextMetrics(dc, &tm); ReleaseDC(NULL, dc); - *x = XDEV2LOGREL(sizeRect.cx); - *y = YDEV2LOGREL(sizeRect.cy); - if (descent) *descent = tm.tmDescent; - if (externalLeading) *externalLeading = tm.tmExternalLeading; + if ( x ) + *x = sizeRect.cx; + if ( y ) + *y = sizeRect.cy; + if ( descent ) + *descent = tm.tmDescent; + if ( externalLeading ) + *externalLeading = tm.tmExternalLeading; } wxMetafile *wxMetafileDC::Close(void) @@ -336,12 +340,12 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i p < (WORD *)&pMFHead ->checksum; ++p) pMFHead ->checksum ^= *p; - FILE *fd = fopen((char *)(const char *)filename, "rb"); + FILE *fd = fopen(filename.fn_str(), "rb"); if (!fd) return FALSE; - char tempFileBuf[256]; - wxGetTempFileName("mf", tempFileBuf); - FILE *fHandle = fopen(tempFileBuf, "wb"); + wxChar tempFileBuf[256]; + wxGetTempFileName(T("mf"), tempFileBuf); + FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb"); if (!fHandle) return FALSE; fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);