Skip to content

Commit

Permalink
Remove unneeded dynamic cast; use c++ for the other one
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Aug 31, 2023
1 parent 3c38dcb commit 4d334d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/custom_buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ SwitchButton::SwitchButton(wxWindow *parent, wxWindowID winid, const wxString& l
Bind(wxEVT_LEFT_DOWN, &SwitchButton::OnMouseClick, this);
#if wxUSE_ACCESSIBILITY
Bind(wxEVT_TOGGLEBUTTON, [=](wxCommandEvent& e) {
wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, wxDynamicCast(this, wxWindow), wxOBJID_CLIENT, wxACC_SELF);
wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, this, wxOBJID_CLIENT, wxACC_SELF);
e.Skip();
});
#endif // wxUSE_ACCESSIBILITY
Expand Down Expand Up @@ -582,7 +582,7 @@ wxAccStatus SwitchButton::accessible::GetState(int childId, long* state)
{
return wxAccessible::GetState(childId, state);
}
auto window = wxDynamicCast(this->GetWindow(), SwitchButton);
auto window = dynamic_cast<SwitchButton*>(this->GetWindow());
if (window->IsFocusable())
{
*state |= wxACC_STATE_SYSTEM_FOCUSABLE;
Expand Down

0 comments on commit 4d334d1

Please sign in to comment.