diff --git a/src/fbutton.cpp b/src/fbutton.cpp index e9bced76..0537e87f 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -373,14 +373,12 @@ void FButton::onAccel (FAccelEvent* ev) { FWidget* focused_widget = static_cast(ev->focusedWidget()); - if ( focused_widget->isWidget() ) + if ( focused_widget && focused_widget->isWidget() ) { FFocusEvent out (fc::FocusOut_Event); FApplication::queueEvent(focused_widget, &out); setFocus(); - - if ( focused_widget ) - focused_widget->redraw(); + focused_widget->redraw(); if ( click_animation ) setDown(); diff --git a/src/flabel.cpp b/src/flabel.cpp index 67adeb3d..25e175fa 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -220,15 +220,12 @@ void FLabel::onAccel (FAccelEvent* ev) { FWidget* focused_widget = static_cast(ev->focusedWidget()); - if ( focused_widget->isWidget() ) + if ( focused_widget && focused_widget->isWidget() ) { FFocusEvent out (fc::FocusOut_Event); FApplication::queueEvent(focused_widget, &out); accel_widget->setFocus(); - - if ( focused_widget ) - focused_widget->redraw(); - + focused_widget->redraw(); accel_widget->redraw(); FFocusEvent in (fc::FocusIn_Event); FApplication::sendEvent(accel_widget, &in); diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 3f2fb7e5..6d9e71a4 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -542,15 +542,12 @@ void FLineEdit::onAccel (FAccelEvent* ev) { FWidget* focused_widget = static_cast(ev->focusedWidget()); - if ( focused_widget->isWidget() ) + if ( focused_widget && focused_widget->isWidget() ) { FFocusEvent out (fc::FocusOut_Event); FApplication::queueEvent(focused_widget, &out); setFocus(); - - if ( focused_widget ) - focused_widget->redraw(); - + focused_widget->redraw(); redraw(); if ( getStatusBar() ) diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index e680d1ba..0e77fa36 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -543,7 +543,7 @@ void FMenuItem::onAccel (FAccelEvent* ev) focused_widget = static_cast(ev->focusedWidget()); - if ( focused_widget->isWidget() ) + if ( focused_widget && focused_widget->isWidget() ) { FFocusEvent out (fc::FocusOut_Event); FApplication::queueEvent(focused_widget, &out); @@ -553,9 +553,7 @@ void FMenuItem::onAccel (FAccelEvent* ev) if ( menu->getSelectedItem() ) menu->getSelectedItem()->setFocus(); - if ( focused_widget ) - focused_widget->redraw(); - + focused_widget->redraw(); menu->redraw(); if ( getStatusBar() ) diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 475b2317..37733ee3 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -298,14 +298,12 @@ void FToggleButton::onAccel (FAccelEvent* ev) { FWidget* focused_widget = static_cast(ev->focusedWidget()); - if ( focused_widget->isWidget() ) + if ( focused_widget && focused_widget->isWidget() ) { FFocusEvent out (fc::FocusOut_Event); FApplication::queueEvent(focused_widget, &out); setFocus(); - - if ( focused_widget ) - focused_widget->redraw(); + focused_widget->redraw(); } }