From bdc9d8f7720fc59900e295461ab02c0d48218c9e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 28 Apr 2019 17:11:55 +0200 Subject: [PATCH] Remove redundant assignments These assignments to the temporary variables are not necessary. --- src/propgrid/propgrid.cpp | 7 ++----- src/propgrid/propgridiface.cpp | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 5bf53eb49b..7d775f6df2 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4488,13 +4488,11 @@ bool wxPropertyGrid::DoExpand( wxPGProperty* p, bool sendEvents ) { wxCHECK_MSG( p, false, wxS("invalid property id") ); - wxPGProperty* pwc = p; - // Store dont-center-splitter flag 'cause we need to temporarily set it bool prevDontCenterSplitter = m_pState->m_dontCenterSplitter; m_pState->m_dontCenterSplitter = true; - bool res = m_pState->DoExpand(pwc); + bool res = m_pState->DoExpand(p); if ( res ) { @@ -4870,8 +4868,7 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even // On double-click, expand/collapse. if ( event.ButtonDClick() && !(m_windowStyle & wxPG_HIDE_MARGIN) ) { - wxPGProperty* pwc = p; - if ( pwc->IsExpanded() ) DoCollapse( p, true ); + if ( p->IsExpanded() ) DoCollapse( p, true ); else DoExpand( p, true ); } diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 488234e521..5c8a6ba4fd 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -103,8 +103,7 @@ wxPGProperty* wxPropertyGridInterface::Append( wxPGProperty* property ) wxPGProperty* wxPropertyGridInterface::AppendIn( wxPGPropArg id, wxPGProperty* newproperty ) { wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullProperty) - wxPGProperty* pwc = (wxPGProperty*) p; - wxPGProperty* retp = m_pState->DoInsert(pwc, pwc->GetChildCount(), newproperty); + wxPGProperty* retp = m_pState->DoInsert(p, p->GetChildCount(), newproperty); return retp; }