From: Stefan Csomor Date: Wed, 15 Apr 2009 17:46:11 +0000 (+0000) Subject: fixing return values and handling of invalid files X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/346662b87a28fed132459db393cdd99132d1c5ca fixing return values and handling of invalid files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/carbon/icon.cpp b/src/osx/carbon/icon.cpp index a28dc19090..37c815e24d 100644 --- a/src/osx/carbon/icon.cpp +++ b/src/osx/carbon/icon.cpp @@ -334,7 +334,7 @@ bool wxIcon::LoadFile( #endif } } - return true ; + return false; } void wxIcon::CopyFromBitmap( const wxBitmap& bmp ) @@ -353,9 +353,11 @@ bool wxICONResourceHandler::LoadFile( int desiredWidth, int desiredHeight ) { wxIcon icon ; - icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) ; - bitmap->CopyFromIcon( icon ) ; - - return bitmap->Ok() ; + if ( icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) ) + { + bitmap->CopyFromIcon( icon ) ; + return bitmap->Ok() ; + } + return false; }