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

@@ -1448,7 +1448,7 @@ void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags )
// GetPropertyByNameWH(). This optimizes for full list parsing.
for ( node = list.begin(); node != list.end(); ++node )
{
wxVariant& childValue = *((wxVariant*)*node);
wxVariant& childValue = *const_cast<wxVariant*>(*node);
wxPGProperty* child = GetPropertyByNameWH(childValue.GetName(), i);
if ( child )
{
@@ -2248,8 +2248,8 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp )
wxPGProperty* wxPGProperty::GetMainParent() const
{
const wxPGProperty* curChild = this;
const wxPGProperty* curParent = m_parent;
wxPGProperty* curChild = const_cast<wxPGProperty*>(this);
wxPGProperty* curParent = m_parent;
while ( !curParent->IsRoot() && !curParent->IsCategory() )
{
@@ -2257,7 +2257,7 @@ wxPGProperty* wxPGProperty::GetMainParent() const
curParent = curParent->m_parent;
}
return (wxPGProperty*) curChild;
return curChild;
}
@@ -2729,7 +2729,7 @@ bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
for ( ; node != pList->end(); ++node )
{
const wxVariant& item = *((const wxVariant*)*node);
const wxVariant& item = *const_cast<const wxVariant*>(*node);
if ( item.GetName() == childName )
{
listValue = &item;
@@ -2753,7 +2753,7 @@ bool wxPGProperty::AreAllChildrenSpecified( wxVariant* pendingList ) const
if ( listValue && listValue->IsType(wxPG_VARIANT_TYPE_LIST) )
childList = listValue;
if ( !child->AreAllChildrenSpecified((wxVariant*)childList) )
if ( !child->AreAllChildrenSpecified(const_cast<wxVariant*>(childList)) )
return false;
}
}