Applied patch [ 818941 ] Initialize vars and clear wxImageList

Also small speedup in wxFileIconsTable


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-12-11 08:01:04 +00:00
parent cea62f9c12
commit 3fc93ebd18
5 changed files with 12 additions and 6 deletions

View File

@@ -1645,16 +1645,17 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime)
return newid;
}
wxBitmap tmpBmp;
tmpBmp.CopyFromIcon(ic);
wxImage img = tmpBmp.ConvertToImage();
wxBitmap bmp;
bmp.CopyFromIcon(ic);
int id = m_smallImageList->GetImageCount();
if (img.GetWidth() == 16 && img.GetHeight() == 16)
m_smallImageList->Add(wxBitmap(img));
if ((bmp.GetWidth() == 16) && (bmp.GetHeight() == 16))
m_smallImageList->Add(bmp);
else
{
if (img.GetWidth() != 32 || img.GetHeight() != 32)
wxImage img = bmp.ConvertToImage();
if ((img.GetWidth() != 32) || (img.GetHeight() != 32))
m_smallImageList->Add(CreateAntialiasedBitmap(CutEmptyBorders(img).Rescale(32, 32)));
else
m_smallImageList->Add(CreateAntialiasedBitmap(img));