From 3fc93ebd18480a085e6f0f3436a1af62848257bf Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 11 Dec 2003 08:01:04 +0000 Subject: [PATCH] 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 --- src/generic/dirctrlg.cpp | 13 +++++++------ src/generic/imaglist.cpp | 1 + src/generic/listctrl.cpp | 2 ++ src/gtk/clipbrd.cpp | 1 + src/gtk1/clipbrd.cpp | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 28e393d177..622be49ebe 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -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)); diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 5fa3b027cd..8aac4fa72e 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -45,6 +45,7 @@ wxGenericImageList::wxGenericImageList( int width, int height, bool mask, int in wxGenericImageList::~wxGenericImageList() { + (void)RemoveAll(); } int wxGenericImageList::GetImageCount() const diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 33b696bd23..394e27505c 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4595,6 +4595,8 @@ bool wxGenericListCtrl::Create(wxWindow *parent, m_mainWin = (wxListMainWindow*) NULL; m_headerWin = (wxListHeaderWindow*) NULL; + m_headerHeight = 0; + if ( !(style & wxLC_MASK_TYPE) ) { style = style | wxLC_LIST; diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 6f316b16ee..8ba52502f1 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -273,6 +273,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject) wxClipboard::wxClipboard() { m_open = FALSE; + m_waiting = FALSE; m_ownsClipboard = FALSE; m_ownsPrimarySelection = FALSE; diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 6f316b16ee..8ba52502f1 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -273,6 +273,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject) wxClipboard::wxClipboard() { m_open = FALSE; + m_waiting = FALSE; m_ownsClipboard = FALSE; m_ownsPrimarySelection = FALSE; -- 2.47.2