Get rid of unnecessary const casts
A pointer to unqualified type are converted implicitly to a more cv-qualified type.
This commit is contained in:
@@ -460,7 +460,7 @@ public:
|
|||||||
|
|
||||||
wxWindow* GetButton( unsigned int i ) { return m_buttons[i]; }
|
wxWindow* GetButton( unsigned int i ) { return m_buttons[i]; }
|
||||||
const wxWindow* GetButton( unsigned int i ) const
|
const wxWindow* GetButton( unsigned int i ) const
|
||||||
{ return const_cast<const wxWindow*>(m_buttons[i]); }
|
{ return m_buttons[i]; }
|
||||||
|
|
||||||
// Utility function to be used in event handlers.
|
// Utility function to be used in event handlers.
|
||||||
int GetButtonId( unsigned int i ) const { return GetButton(i)->GetId(); }
|
int GetButtonId( unsigned int i ) const { return GetButton(i)->GetId(); }
|
||||||
|
@@ -270,7 +270,7 @@ public:
|
|||||||
const wxPropertyGrid* GetGrid() const
|
const wxPropertyGrid* GetGrid() const
|
||||||
{
|
{
|
||||||
wxASSERT(m_pPropGrid);
|
wxASSERT(m_pPropGrid);
|
||||||
return const_cast<const wxPropertyGrid*>(m_pPropGrid);
|
return m_pPropGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns iterator class instance.
|
// Returns iterator class instance.
|
||||||
|
@@ -1162,7 +1162,7 @@ public:
|
|||||||
|
|
||||||
const wxPGCommonValue* GetCommonValue( unsigned int i ) const
|
const wxPGCommonValue* GetCommonValue( unsigned int i ) const
|
||||||
{
|
{
|
||||||
return const_cast<const wxPGCommonValue*>(m_commonValues[i]);
|
return m_commonValues[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns number of common values.
|
// Returns number of common values.
|
||||||
|
@@ -305,7 +305,7 @@ public:
|
|||||||
|
|
||||||
const wxPGProperty* GetFirst( int flags = wxPG_ITERATE_ALL ) const
|
const wxPGProperty* GetFirst( int flags = wxPG_ITERATE_ALL ) const
|
||||||
{
|
{
|
||||||
return const_cast<const wxPGProperty*>(GetFirst(flags));
|
return GetFirst(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns pointer to a property with given name (case-sensitive).
|
// Returns pointer to a property with given name (case-sensitive).
|
||||||
|
@@ -412,7 +412,7 @@ public:
|
|||||||
|
|
||||||
const wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) const
|
const wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) const
|
||||||
{
|
{
|
||||||
return const_cast<const wxPGProperty*>(GetLastItem(flags));
|
return GetLastItem(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns currently selected property.
|
// Returns currently selected property.
|
||||||
|
@@ -771,7 +771,7 @@ bool PROPNAME::OnEvent( wxPropertyGrid* propgrid, \
|
|||||||
wxWindow* primary, wxEvent& event ) \
|
wxWindow* primary, wxEvent& event ) \
|
||||||
{ \
|
{ \
|
||||||
if ( event.GetEventType() == wxEVT_BUTTON ) \
|
if ( event.GetEventType() == wxEVT_BUTTON ) \
|
||||||
return OnButtonClick(propgrid,primary, const_cast<const wxChar*>(CUSTBUTTXT)); \
|
return OnButtonClick(propgrid,primary, CUSTBUTTXT); \
|
||||||
return false; \
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2729,7 +2729,7 @@ bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
|
|||||||
|
|
||||||
for ( ; node != pList->end(); ++node )
|
for ( ; node != pList->end(); ++node )
|
||||||
{
|
{
|
||||||
const wxVariant& item = *const_cast<const wxVariant*>(*node);
|
const wxVariant& item = **node;
|
||||||
if ( item.GetName() == childName )
|
if ( item.GetName() == childName )
|
||||||
{
|
{
|
||||||
listValue = &item;
|
listValue = &item;
|
||||||
|
Reference in New Issue
Block a user