From: Vadim Zeitlin Date: Wed, 29 Feb 2012 13:58:52 +0000 (+0000) Subject: Move checks for m_art != NULL before code using m_art in wxAuiToolBar. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f90b69e028295b8b301d277a16adf9f27d6932ab Move checks for m_art != NULL before code using m_art in wxAuiToolBar. It doesn't make sense to check whether a pointer is NULL after using it, so do the checks first. In fact the m_art pointer probably can never be NULL at all as other code uses it without checking and so these checks could probably be removed completely, but keep them for now as I'm not totally sure if having NULL art provider is really impossible. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index d9bb3046b4..83a1788786 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -2654,14 +2654,13 @@ void wxAuiToolBar::OnRightDown(wxMouseEvent& evt) return; } - if (m_overflowSizerItem) + if (m_overflowSizerItem && m_art) { int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); if (dropdown_size > 0 && evt.m_x > cli_rect.width - dropdown_size && evt.m_y >= 0 && - evt.m_y < cli_rect.height && - m_art) + evt.m_y < cli_rect.height) { return; } @@ -2721,14 +2720,13 @@ void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt) return; } - if (m_overflowSizerItem) + if (m_overflowSizerItem && m_art) { int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); if (dropdown_size > 0 && evt.m_x > cli_rect.width - dropdown_size && evt.m_y >= 0 && - evt.m_y < cli_rect.height && - m_art) + evt.m_y < cli_rect.height) { return; }