Use const_cast to change the constness

This commit is contained in:
Artur Wieczorek
2019-06-16 17:09:23 +02:00
parent 2ebdfb7a40
commit b064608c2a
9 changed files with 20 additions and 20 deletions

View File

@@ -217,12 +217,12 @@ public:
PROPERTY* property = NULL, int dir = 1)
: wxPropertyGridIteratorBase()
{
Init((wxPropertyGridPageState*)state, flags, (wxPGProperty*)property, dir);
Init(const_cast<wxPropertyGridPageState*>(state), flags, const_cast<wxPGProperty*>(property), dir);
}
wxPGIterator(STATE* state, int flags, int startPos, int dir = 0)
: wxPropertyGridIteratorBase()
{
Init((wxPropertyGridPageState*)state, flags, startPos, dir);
Init(const_cast<wxPropertyGridPageState*>(state), flags, startPos, dir);
}
wxPGIterator()
: wxPropertyGridIteratorBase()
@@ -248,7 +248,7 @@ public:
wxPGIterator operator++(int) { wxPGIterator it = *this; Next(); return it; }
wxPGIterator& operator--() { Prev(); return *this; }
wxPGIterator operator--(int) { wxPGIterator it = *this; Prev(); return it; }
PROPERTY* operator *() const { return (PROPERTY*)m_property; }
PROPERTY* operator *() const { return const_cast<PROPERTY*>(m_property); }
static PROPERTY* OneStep(STATE* state, int flags = wxPG_ITERATE_DEFAULT,
PROPERTY* property = NULL, int dir = 1)
{
@@ -412,7 +412,7 @@ public:
const wxPGProperty* GetLastItem( int flags = wxPG_ITERATE_DEFAULT ) const
{
return ((wxPropertyGridPageState*)this)->GetLastItem(flags);
return const_cast<const wxPGProperty*>(GetLastItem(flags));
}
// Returns currently selected property.