]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/metafile.cpp
fixed memory leak in RestoreState
[wxWidgets.git] / src / os2 / metafile.cpp
index 797b023742c5eb9a9bf4e9c04d1e27ca86e0e169..82709b4ccb8f5eb9002ab4072282f3fb7ff81dd6 100644 (file)
@@ -15,8 +15,8 @@
 #if wxUSE_METAFILE
 
 #ifndef WX_PRECOMP
-#include "wx/utils.h"
-#include "wx/app.h"
+    #include "wx/utils.h"
+    #include "wx/app.h"
 #endif
 
 #include "wx/metafile.h"
@@ -80,7 +80,7 @@ bool wxMetafile::SetClipboard(int width, int height)
     if (!alreadyOpen)
     {
         wxOpenClipboard();
-        if (!wxEmptyClipboard()) return FALSE;
+        if (!wxEmptyClipboard()) return false;
     }
     bool success = wxSetClipboardData(wxDF_METAFILE, this, width,height);
     if (!alreadyOpen) wxCloseClipboard();
@@ -91,7 +91,7 @@ bool wxMetafile::SetClipboard(int width, int height)
 bool wxMetafile::Play(wxDC *dc)
 {
     if (!m_refData)
-        return FALSE;
+        return false;
 
  //   if (dc->GetHDC() && M_METAFILEDATA->m_metafile)
  //       PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) M_METAFILEDATA->m_metafile);
@@ -188,12 +188,12 @@ void wxMetafileDC::GetTextExtent(const wxString& WXUNUSED(string),
                                  long *WXUNUSED(y),
                                  long *WXUNUSED(descent),
                                  long *WXUNUSED(externalLeading),
-                                 wxFont *theFont,
+                                 const wxFont *theFont,
                                  bool WXUNUSED(use16bit) ) const
 {
-    wxFont *fontToUse = theFont;
+    const wxFont *fontToUse = theFont;
     if (!fontToUse)
-        fontToUse = (wxFont*) &m_font;
+        fontToUse = &m_font;
 
     // TODO:
 /*
@@ -354,13 +354,13 @@ bool wxMakeMetafilePlaceable(const wxString& WXUNUSED(filename),
 
     FILE *fd = fopen(filename.fn_str(), "rb");
     if (!fd)
-        return FALSE;
+        return false;
 
     wxChar tempFileBuf[256];
     wxGetTempFileName(wxT("mf"), tempFileBuf);
     FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
     if (!fHandle)
-        return FALSE;
+        return false;
     fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);
 
     // Calculate origin and extent