X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59704b49c212e24f0292b6d1470fc1cd9d4afd3e..1ddb6d28576c3ab21f80d8a3815fcccb1545961c:/src/generic/headerctrlg.cpp diff --git a/src/generic/headerctrlg.cpp b/src/generic/headerctrlg.cpp index 4bac640faa..37d848fc18 100644 --- a/src/generic/headerctrlg.cpp +++ b/src/generic/headerctrlg.cpp @@ -145,8 +145,6 @@ wxSize wxHeaderCtrl::DoGetBestSize() const int wxHeaderCtrl::GetColStart(unsigned int idx) const { - wxHeaderCtrl * const self = const_cast(this); - int pos = m_scrollOffset; for ( unsigned n = 0; ; n++ ) { @@ -154,7 +152,7 @@ int wxHeaderCtrl::GetColStart(unsigned int idx) const if ( i == idx ) break; - const wxHeaderColumn& col = self->GetColumn(i); + const wxHeaderColumn& col = GetColumn(i); if ( col.IsShown() ) pos += col.GetWidth(); } @@ -166,19 +164,17 @@ int wxHeaderCtrl::GetColEnd(unsigned int idx) const { int x = GetColStart(idx); - return x + const_cast(this)->GetColumn(idx).GetWidth(); + return x + GetColumn(idx).GetWidth(); } unsigned int wxHeaderCtrl::FindColumnAtPoint(int x, bool *onSeparator) const { - wxHeaderCtrl * const self = const_cast(this); - int pos = 0; const unsigned count = GetColumnCount(); for ( unsigned n = 0; n < count; n++ ) { const unsigned idx = m_colIndices[n]; - const wxHeaderColumn& col = self->GetColumn(idx); + const wxHeaderColumn& col = GetColumn(idx); if ( col.IsHidden() ) continue; @@ -204,6 +200,8 @@ unsigned int wxHeaderCtrl::FindColumnAtPoint(int x, bool *onSeparator) const } } + if ( onSeparator ) + *onSeparator = false; return COL_NONE; }