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
This commit is contained in:
Vadim Zeitlin
2012-02-29 13:58:52 +00:00
parent b02dd12239
commit f90b69e028

View File

@@ -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;
}