X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad6bd8701eda692b5fcf6f833e041c38756c608a..da494b405d0826b343ea6d249bbac27061e11d3e:/src/os2/bitmap.cpp diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index 92ca4c551e..76b31572f2 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -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)