]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/bitmap.cpp
Added new __WXMOTIF20__ macro, which is true if the Motif version
[wxWidgets.git] / src / os2 / bitmap.cpp
index 92ca4c551ee821f396dbb28174c1cb58b98d2fb9..76b31572f25ba85cbfcd59a92c3c539a0d23bb4c 100644 (file)
@@ -58,7 +58,7 @@ wxBitmapRefData::wxBitmapRefData()
     m_pSelectedInto = NULL;
     m_nNumColors    = 0;
     m_pBitmapMask   = NULL;
-    m_hBitmap = (WXHBITMAP) NULL;
+    m_hBitmap       = (WXHBITMAP) NULL;
 } // end of wxBitmapRefData::wxBitmapRefData
 
 void wxBitmapRefData::Free()
@@ -74,9 +74,11 @@ void wxBitmapRefData::Free()
             wxLogLastError("GpiDeleteBitmap(hbitmap)");
         }
     }
-
-    delete m_pBitmapMask;
-    m_pBitmapMask = NULL;
+    if (m_pBitmapMask)
+    {
+        delete m_pBitmapMask;
+        m_pBitmapMask = NULL;
+    }
 } // end of wxBitmapRefData::Free
 
 // ----------------------------------------------------------------------------
@@ -293,14 +295,15 @@ wxBitmap::wxBitmap(
 } // end of wxBitmap::wxBitmap
 
 wxBitmap::wxBitmap(
-  const wxString&                   rFilename
+  int                               nId
 , long                              lType
 )
 {
     Init();
-    LoadFile( rFilename
+    LoadFile( nId
              ,(int)lType
             );
+    SetId(nId);
 } // end of wxBitmap::wxBitmap
 
 bool wxBitmap::Create(
@@ -409,7 +412,7 @@ bool wxBitmap::CreateFromXpm(
 } // end of wxBitmap::CreateFromXpm
 
 bool wxBitmap::LoadFile(
-  const wxString&                   rFilename
+  int                               nId
 , long                              lType
 )
 {
@@ -426,8 +429,7 @@ bool wxBitmap::LoadFile(
         m_refData = new wxBitmapRefData;
 
         return(pHandler->LoadFile( this
-                                  ,rFilename
-                                  ,hPs
+                                  ,nId
                                   ,lType
                                   , -1
                                   , -1
@@ -435,14 +437,7 @@ bool wxBitmap::LoadFile(
     }
     else
     {
-        wxImage                     vImage;
-
-        if (!vImage.LoadFile(rFilename, lType) || !vImage.Ok() )
-            return(FALSE);
-
-        *this = wxBitmap(vImage);
-
-        return(TRUE);
+        return(FALSE);
     }
 } // end of wxBitmap::LoadFile
 
@@ -513,7 +508,7 @@ bool wxBitmap::SaveFile(
 
 
 // ----------------------------------------------------------------------------
-// wxImage-wxBitmap convertion
+// wxImage-wxBitmap conversion
 // ----------------------------------------------------------------------------
 
 bool wxBitmap::CreateFromImage (
@@ -1479,8 +1474,7 @@ bool wxBitmapHandler::Create(
 
 bool wxBitmapHandler::Load(
   wxGDIImage*                       pImage
-, const wxString&                   rName
-, HPS                               hPs
+, int                               nId
 , long                              lFlags
 , int                               nWidth
 , int                               nHeight
@@ -1491,8 +1485,7 @@ bool wxBitmapHandler::Load(
                                                            );
 
     return(pBitmap ? LoadFile( pBitmap
-                              ,rName
-                              ,hPs
+                              ,nId
                               ,lFlags
                               ,nWidth
                               ,nHeight
@@ -1529,8 +1522,7 @@ bool wxBitmapHandler::Create(
 
 bool wxBitmapHandler::LoadFile(
   wxBitmap*                         WXUNUSED(pBitmap)
-, const wxString&                   WXUNUSED(rName)
-, HPS                               WXUNUSED(hPs)
+, int                               WXUNUSED(nId)
 , long                              WXUNUSED(lType)
 , int                               WXUNUSED(nDesiredWidth)
 , int                               WXUNUSED(nDesiredHeight)