X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac32ba44a150c9de37a9b56ef7cb10521d0e9347..6b707fc394b2601878996dc7581c6d7427f8f4dd:/src/univ/toolbar.cpp diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index c8ec9c1a20..74ff8b55e0 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -18,7 +18,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "univtoolbar.h" #endif @@ -645,6 +645,8 @@ bool wxToolBar::PerformAction(const wxControlAction& action, const wxString& strArg) { wxToolBarTool *tool = (wxToolBarTool*) FindById(numArg); + if (!tool) + return false; if ( action == wxACTION_TOOLBAR_TOGGLE ) { @@ -849,9 +851,9 @@ bool wxStdToolbarInputHandler::HandleMouseMove(wxInputConsumer *consumer, } bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer, - const wxFocusEvent& event) + const wxFocusEvent& WXUNUSED(event)) { - if (m_toolCapture) + if ( m_toolCapture ) { // We shouldn't be left with a highlighted button consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );