diff options
-rw-r--r-- | vcl/source/control/button.cxx | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index d831794b0c54..fd0beb44d6ae 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2272,15 +2272,12 @@ void RadioButton::ImplUncheckAllOther() // iterate over radio button group and checked buttons for (auto aI = aGroup.begin(), aEnd = aGroup.end(); aI != aEnd; ++aI) { - RadioButton *pWindow = *aI; + VclPtr<RadioButton> pWindow = *aI; if ( pWindow->IsChecked() ) { - ImplDelData aDelData; - pWindow->ImplAddDel( &aDelData ); pWindow->SetState( false ); - if ( aDelData.IsDead() ) + if ( pWindow->IsDisposed() ) return; - pWindow->ImplRemoveDel( &aDelData ); } // not inside if clause to always remove wrongly set WB_TABSTOPS @@ -2295,24 +2292,22 @@ void RadioButton::ImplCallClick( bool bGrabFocus, GetFocusFlags nFocusFlags ) mpWindowImpl->mnStyle |= WB_TABSTOP; Invalidate(); Update(); - ImplDelData aDelData; - ImplAddDel( &aDelData ); + VclPtr<vcl::Window> xWindow = this; if ( mbRadioCheck ) ImplUncheckAllOther(); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; if ( bGrabFocus ) ImplGrabFocus( nFocusFlags ); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; if ( mbStateChanged ) Toggle(); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; Click(); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; - ImplRemoveDel( &aDelData ); mbStateChanged = false; } @@ -2737,17 +2732,15 @@ void RadioButton::Check( bool bCheck ) if ( mbChecked != bCheck ) { mbChecked = bCheck; - ImplDelData aDelData; - ImplAddDel( &aDelData ); + VclPtr<vcl::Window> xWindow = this; CompatStateChanged( StateChangedType::State ); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; if ( bCheck && mbRadioCheck ) ImplUncheckAllOther(); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; Toggle(); - ImplRemoveDel( &aDelData ); } } @@ -3231,17 +3224,15 @@ void CheckBox::ImplCheck() eNewState = TRISTATE_FALSE; meState = eNewState; - ImplDelData aDelData; - ImplAddDel( &aDelData ); + VclPtr<vcl::Window> xWindow = this; if( (GetStyle() & WB_EARLYTOGGLE) ) Toggle(); Invalidate(); Update(); if( ! (GetStyle() & WB_EARLYTOGGLE) ) Toggle(); - if ( aDelData.IsDead() ) + if ( xWindow->IsDisposed() ) return; - ImplRemoveDel( &aDelData ); Click(); } |