Remove redundant assignments

These assignments to the temporary variables are not necessary.
This commit is contained in:
Artur Wieczorek
2019-04-28 17:11:55 +02:00
parent 9df9e32a70
commit bdc9d8f772
2 changed files with 3 additions and 7 deletions

View File

@@ -4488,13 +4488,11 @@ bool wxPropertyGrid::DoExpand( wxPGProperty* p, bool sendEvents )
{ {
wxCHECK_MSG( p, false, wxS("invalid property id") ); wxCHECK_MSG( p, false, wxS("invalid property id") );
wxPGProperty* pwc = p;
// Store dont-center-splitter flag 'cause we need to temporarily set it // Store dont-center-splitter flag 'cause we need to temporarily set it
bool prevDontCenterSplitter = m_pState->m_dontCenterSplitter; bool prevDontCenterSplitter = m_pState->m_dontCenterSplitter;
m_pState->m_dontCenterSplitter = true; m_pState->m_dontCenterSplitter = true;
bool res = m_pState->DoExpand(pwc); bool res = m_pState->DoExpand(p);
if ( res ) if ( res )
{ {
@@ -4870,8 +4868,7 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even
// On double-click, expand/collapse. // On double-click, expand/collapse.
if ( event.ButtonDClick() && !(m_windowStyle & wxPG_HIDE_MARGIN) ) if ( event.ButtonDClick() && !(m_windowStyle & wxPG_HIDE_MARGIN) )
{ {
wxPGProperty* pwc = p; if ( p->IsExpanded() ) DoCollapse( p, true );
if ( pwc->IsExpanded() ) DoCollapse( p, true );
else DoExpand( p, true ); else DoExpand( p, true );
} }

View File

@@ -103,8 +103,7 @@ wxPGProperty* wxPropertyGridInterface::Append( wxPGProperty* property )
wxPGProperty* wxPropertyGridInterface::AppendIn( wxPGPropArg id, wxPGProperty* newproperty ) wxPGProperty* wxPropertyGridInterface::AppendIn( wxPGPropArg id, wxPGProperty* newproperty )
{ {
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullProperty) wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullProperty)
wxPGProperty* pwc = (wxPGProperty*) p; wxPGProperty* retp = m_pState->DoInsert(p, p->GetChildCount(), newproperty);
wxPGProperty* retp = m_pState->DoInsert(pwc, pwc->GetChildCount(), newproperty);
return retp; return retp;
} }