]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/iconbndl.cpp
Small typo, big effect.
[wxWidgets.git] / src / common / iconbndl.cpp
index 13a5d84d34d57757863bf29fab381f73e26b7b84..ef64f80fae6d7299a178a87f962199c70788f8dc 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/settings.h"
-    #include "wx/image.h"
     #include "wx/icon.h"
     #include "wx/log.h"
     #include "wx/intl.h"
 #endif
 
+#ifndef _WX_IMAGE_H_
+    #include "wx/image.h"
+#endif
+
 #include "wx/iconbndl.h"
 #include "wx/arrimpl.cpp"
 
@@ -80,6 +83,8 @@ const wxIcon& wxIconBundle::GetIcon( const wxSize& size ) const
 
     for( i = 0; i < max; ++i )
     {
+        if( !m_icons[i].Ok() )
+            continue;
         wxCoord sx = m_icons[i].GetWidth(), sy = m_icons[i].GetHeight();
         // requested size
         if( sx == size.x && sy == size.y )
@@ -102,7 +107,7 @@ void wxIconBundle::AddIcon( const wxIcon& icon )
     for( i = 0; i < max; ++i )
     {
         wxIcon& tmp = m_icons[i];
-        if( tmp.GetWidth() == icon.GetWidth() &&
+        if( tmp.Ok() && tmp.GetWidth() == icon.GetWidth() &&
             tmp.GetHeight() == icon.GetHeight() )
         {
             tmp = icon;