Get rid of unnecessary casts to wxPGProperty*

These casts are unnecessary and can be removed.
This commit is contained in:
Artur Wieczorek
2019-04-28 17:04:06 +02:00
parent d06d403136
commit 9df9e32a70
5 changed files with 21 additions and 21 deletions

View File

@@ -1477,7 +1477,7 @@ public:
// Returns true if this is a sub-property.
bool IsSubProperty() const
{
wxPGProperty* parent = (wxPGProperty*)m_parent;
wxPGProperty* parent = m_parent;
if ( parent && !parent->IsCategory() )
return true;
return false;

View File

@@ -2562,7 +2562,7 @@ int wxPGProperty::GetChildrenHeight( int lh, int iMax_ ) const
for ( unsigned int i = 0; i < iMax; i++ )
{
wxPGProperty* pwc = (wxPGProperty*) Item(i);
wxPGProperty* pwc = Item(i);
if ( !pwc->HasFlag(wxPG_PROP_HIDDEN) )
{
@@ -2608,7 +2608,7 @@ wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y,
if ( pwc->IsExpanded() &&
pwc->GetChildCount() > 0 )
{
result = (wxPGProperty*) pwc->GetItemAtY( y, lh, &iy );
result = pwc->GetItemAtY( y, lh, &iy );
if ( result )
break;
}
@@ -2634,7 +2634,7 @@ wxPGProperty* wxPGProperty::GetItemAtY( unsigned int y,
}
*/
return (wxPGProperty*) result;
return result;
}
void wxPGProperty::Empty()

View File

@@ -4488,7 +4488,7 @@ bool wxPropertyGrid::DoExpand( wxPGProperty* p, bool sendEvents )
{
wxCHECK_MSG( p, false, wxS("invalid property id") );
wxPGProperty* pwc = (wxPGProperty*)p;
wxPGProperty* pwc = p;
// Store dont-center-splitter flag 'cause we need to temporarily set it
bool prevDontCenterSplitter = m_pState->m_dontCenterSplitter;
@@ -4870,7 +4870,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 = (wxPGProperty*)p;
wxPGProperty* pwc = p;
if ( pwc->IsExpanded() ) DoCollapse( p, true );
else DoExpand( p, true );
}
@@ -4962,7 +4962,7 @@ bool wxPropertyGrid::HandleMouseClick( int x, unsigned int y, wxMouseEvent &even
if ( (y2 >= m_buttonSpacingY && y2 < (m_buttonSpacingY+m_iconHeight)) )
{
// On click on expander button, expand/collapse
if ( ((wxPGProperty*)p)->IsExpanded() )
if ( p->IsExpanded() )
DoCollapse( p, true );
else
DoExpand( p, true );

View File

@@ -123,7 +123,7 @@ wxPGProperty* wxPropertyGridInterface::Insert( wxPGPropArg id, wxPGProperty* pro
wxPGProperty* wxPropertyGridInterface::Insert( wxPGPropArg id, int index, wxPGProperty* newproperty )
{
wxPG_PROP_ARG_CALL_PROLOG_RETVAL(wxNullProperty)
wxPGProperty* retp = m_pState->DoInsert((wxPGProperty*)p,index,newproperty);
wxPGProperty* retp = m_pState->DoInsert(p,index,newproperty);
RefreshGrid();
return retp;
}
@@ -323,7 +323,7 @@ bool wxPropertyGridInterface::ExpandAll( bool doExpand )
for ( it = GetVIterator( wxPG_ITERATE_ALL ); !it.AtEnd(); it.Next() )
{
wxPGProperty* p = (wxPGProperty*) it.GetProperty();
wxPGProperty* p = it.GetProperty();
if ( p->GetChildCount() )
{
if ( doExpand )
@@ -493,17 +493,17 @@ void wxPropertyGridInterface::GetPropertiesWithFlag( wxArrayPGProperty* targetAr
!it.AtEnd();
it.Next() )
{
const wxPGProperty* property = it.GetProperty();
wxPGProperty* property = it.GetProperty();
if ( !inverse )
{
if ( property->HasFlagsExact(flags) )
targetArr->push_back((wxPGProperty*)property);
targetArr->push_back(property);
}
else
{
if ( !property->HasFlagsExact(flags) )
targetArr->push_back((wxPGProperty*)property);
targetArr->push_back(property);
}
}
}

View File

@@ -417,10 +417,10 @@ wxPGProperty* wxPropertyGridPageState::GetLastItem( int flags )
wxPG_ITERATOR_CREATE_MASKS(flags, wxPGProperty::FlagType itemExMask, wxPGProperty::FlagType parentExMask)
// First, get last child of last parent
wxPGProperty* pwc = (wxPGProperty*)m_properties->Last();
wxPGProperty* pwc = m_properties->Last();
while ( pwc->GetChildCount() &&
wxPG_ITERATOR_PARENTEXMASK_TEST(pwc, parentExMask) )
pwc = (wxPGProperty*) pwc->Last();
pwc = pwc->Last();
// Then, if it doesn't fit our criteria, back up until we find something that does
if ( pwc->HasFlag(itemExMask) )
@@ -428,7 +428,7 @@ wxPGProperty* wxPropertyGridPageState::GetLastItem( int flags )
wxPropertyGridIterator it( this, flags, pwc );
for ( ; !it.AtEnd(); it.Prev() )
;
pwc = (wxPGProperty*) it.GetProperty();
pwc = it.GetProperty();
}
return pwc;
@@ -436,12 +436,12 @@ wxPGProperty* wxPropertyGridPageState::GetLastItem( int flags )
wxPropertyCategory* wxPropertyGridPageState::GetPropertyCategory( const wxPGProperty* p ) const
{
const wxPGProperty* parent = (const wxPGProperty*)p;
const wxPGProperty* grandparent = (const wxPGProperty*)parent->GetParent();
const wxPGProperty* parent = p;
const wxPGProperty* grandparent = parent->GetParent();
do
{
parent = grandparent;
grandparent = (wxPGProperty*)parent->GetParent();
grandparent = parent->GetParent();
if ( parent->IsCategory() && grandparent )
return (wxPropertyCategory*)parent;
} while ( grandparent );
@@ -1427,7 +1427,7 @@ wxVariant wxPropertyGridPageState::DoGetPropertyValues( const wxString& listname
wxPGProperty* baseparent,
long flags ) const
{
wxPGProperty* pwc = (wxPGProperty*) baseparent;
wxPGProperty* pwc = baseparent;
// Root is the default base-parent.
if ( !pwc )
@@ -2046,10 +2046,10 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
if ( p == item ) { cat_index = i; break; }
if ( p->IsCategory() )
{
int subind = ((wxPGProperty*)p)->Index(item);
int subind = p->Index(item);
if ( subind != wxNOT_FOUND )
{
cat_parent = ((wxPGProperty*)p);
cat_parent = p;
cat_index = subind;
break;
}