]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement wxIcon::LoadFile by defering to wxBitmap implementation instead of creating...
authorDavid Elliott <dfe@tgwbd.org>
Thu, 29 Nov 2007 07:24:19 +0000 (07:24 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Thu, 29 Nov 2007 07:24:19 +0000 (07:24 +0000)
Patch authored by Software 2000 Ltd.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/icon.mm

index 09924c8cb7cc16bc3518d843310101e8a29fcb2e..91b059ba596f601f1781b26d7924e6b9762b875e 100644 (file)
@@ -108,17 +108,9 @@ bool wxIcon::CreateFromXpm(const char **xpm)
 bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
     int desiredWidth, int desiredHeight)
 {
-    UnRef();
-
-    m_refData = new wxIconRefData;
-    M_ICONDATA->m_width = 5;
-    M_ICONDATA->m_height = 5;
-    M_ICONDATA->m_cocoaNSImage = [[NSImage alloc] initWithSize:NSMakeSize(5,5)];
-    M_ICONDATA->m_ok = true;
-    M_ICONDATA->m_numColors = 0;
-    M_ICONDATA->m_quality = 0;
-
-    return false;
+    wxBitmap bitmap(filename, type);
+    CopyFromBitmap(bitmap);
+    return bitmap.Ok();
 }
 
 void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)