]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/metafile.cpp
DC headers don't need to be in gtk/private.h
[wxWidgets.git] / src / os2 / metafile.cpp
index b2b402c794a65f773ca8b53d1dbffb35d60ec4e6..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,15 +91,11 @@ bool wxMetafile::SetClipboard(int width, int height)
 bool wxMetafile::Play(wxDC *dc)
 {
     if (!m_refData)
-        return FALSE;
-
-    dc->BeginDrawing();
+        return false;
 
  //   if (dc->GetHDC() && M_METAFILEDATA->m_metafile)
  //       PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) M_METAFILEDATA->m_metafile);
 
-    dc->EndDrawing();
-
     return true;
 }
 
@@ -192,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:
 /*
@@ -358,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