No changes, just make wxDataViewMainWindow::GetRowCount() const.
This is clearly an accessor function, so make it const, even if it requires a const_cast<> inside it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -637,7 +637,7 @@ public:
|
|||||||
// the displaying number of the tree are changing along with the
|
// the displaying number of the tree are changing along with the
|
||||||
// expanding/collapsing of the tree nodes
|
// expanding/collapsing of the tree nodes
|
||||||
unsigned int GetLastVisibleRow();
|
unsigned int GetLastVisibleRow();
|
||||||
unsigned int GetRowCount();
|
unsigned int GetRowCount() const;
|
||||||
|
|
||||||
const wxDataViewSelection& GetSelections() const { return m_selection; }
|
const wxDataViewSelection& GetSelections() const { return m_selection; }
|
||||||
void SetSelections( const wxDataViewSelection & sel )
|
void SetSelections( const wxDataViewSelection & sel )
|
||||||
@@ -706,7 +706,7 @@ public:
|
|||||||
void StartEditing(const wxDataViewItem& item, const wxDataViewColumn* col);
|
void StartEditing(const wxDataViewItem& item, const wxDataViewColumn* col);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int RecalculateCount();
|
int RecalculateCount() const;
|
||||||
|
|
||||||
// Return false only if the event was vetoed by its handler.
|
// Return false only if the event was vetoed by its handler.
|
||||||
bool SendExpanderEvent(wxEventType type, const wxDataViewItem& item);
|
bool SendExpanderEvent(wxEventType type, const wxDataViewItem& item);
|
||||||
@@ -2576,12 +2576,14 @@ unsigned int wxDataViewMainWindow::GetLastVisibleRow()
|
|||||||
return wxMin( GetRowCount()-1, row );
|
return wxMin( GetRowCount()-1, row );
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int wxDataViewMainWindow::GetRowCount()
|
unsigned int wxDataViewMainWindow::GetRowCount() const
|
||||||
{
|
{
|
||||||
if ( m_count == -1 )
|
if ( m_count == -1 )
|
||||||
{
|
{
|
||||||
m_count = RecalculateCount();
|
wxDataViewMainWindow* const
|
||||||
UpdateDisplay();
|
self = const_cast<wxDataViewMainWindow*>(this);
|
||||||
|
self->m_count = RecalculateCount();
|
||||||
|
self->UpdateDisplay();
|
||||||
}
|
}
|
||||||
return m_count;
|
return m_count;
|
||||||
}
|
}
|
||||||
@@ -3297,7 +3299,7 @@ wxRect wxDataViewMainWindow::GetItemRect( const wxDataViewItem & item,
|
|||||||
return itemRect;
|
return itemRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxDataViewMainWindow::RecalculateCount()
|
int wxDataViewMainWindow::RecalculateCount() const
|
||||||
{
|
{
|
||||||
if (IsVirtualList())
|
if (IsVirtualList())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user