No real changes, just use const_cast<> instead of C casts.
Replace many comments indicating that the C cast used was really a const_cast<> with the proper cast itself. There is no reason to not use it any longer, all the supported compilers understand it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5892,8 +5892,8 @@ void wxGrid::EnableCellEditControl( bool enable )
|
||||
|
||||
bool wxGrid::IsCurrentCellReadOnly() const
|
||||
{
|
||||
// const_cast
|
||||
wxGridCellAttr* attr = ((wxGrid *)this)->GetCellAttr(m_currentCellCoords);
|
||||
wxGridCellAttr*
|
||||
attr = const_cast<wxGrid *>(this)->GetCellAttr(m_currentCellCoords);
|
||||
bool readonly = attr->IsReadOnly();
|
||||
attr->DecRef();
|
||||
|
||||
@@ -7270,7 +7270,7 @@ void wxGrid::CacheAttr(int row, int col, wxGridCellAttr *attr) const
|
||||
{
|
||||
if ( attr != NULL )
|
||||
{
|
||||
wxGrid *self = (wxGrid *)this; // const_cast
|
||||
wxGrid * const self = const_cast<wxGrid *>(this);
|
||||
|
||||
self->ClearAttrCache();
|
||||
self->m_attrCache.row = row;
|
||||
@@ -8164,7 +8164,7 @@ void wxGrid::AutoSizeColLabelSize( int col )
|
||||
|
||||
wxSize wxGrid::DoGetBestSize() const
|
||||
{
|
||||
wxGrid *self = (wxGrid *)this; // const_cast
|
||||
wxGrid * const self = const_cast<wxGrid *>(this);
|
||||
|
||||
// we do the same as in AutoSize() here with the exception that we don't
|
||||
// change the column/row sizes, only calculate them
|
||||
|
Reference in New Issue
Block a user