]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing return values and handling of invalid files
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 15 Apr 2009 17:46:11 +0000 (17:46 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 15 Apr 2009 17:46:11 +0000 (17:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/icon.cpp

index a28dc190908a84e498159de6f998d7085b67f4bf..37c815e24d3e0d6047e63822b10194f88af0766b 100644 (file)
@@ -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;
 }