Column widths were recomputed too soon -- after the model changed, but
before the control's own data structures were updated to reflect the
change. This could lead to incorrect calculations or worse, crashes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68806
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxDataViewItem & item)
{
bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxDataViewItem & item)
{
- GetOwner()->InvalidateColBestWidths();
+ GetOwner()->InvalidateColBestWidths();
UpdateDisplay();
return true;
UpdateDisplay();
return true;
bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
const wxDataViewItem& item)
{
bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent,
const wxDataViewItem& item)
{
- GetOwner()->InvalidateColBestWidths();
-
if (IsVirtualList())
{
wxDataViewVirtualListModel *list_model =
if (IsVirtualList())
{
wxDataViewVirtualListModel *list_model =
if( m_currentRow > GetRowCount() )
ChangeCurrentRow(m_count - 1);
if( m_currentRow > GetRowCount() )
ChangeCurrentRow(m_count - 1);
+ GetOwner()->InvalidateColBestWidths();
UpdateDisplay();
return true;
UpdateDisplay();
return true;
bool wxDataViewMainWindow::ItemChanged(const wxDataViewItem & item)
{
bool wxDataViewMainWindow::ItemChanged(const wxDataViewItem & item)
{
- GetOwner()->InvalidateColBestWidths();
-
SortPrepare();
g_model->Resort();
SortPrepare();
g_model->Resort();
+ GetOwner()->InvalidateColBestWidths();
+
// Send event
wxWindow *parent = GetParent();
wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId());
// Send event
wxWindow *parent = GetParent();
wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId());
if (view_column == -1)
return false;
if (view_column == -1)
return false;
- GetOwner()->InvalidateColBestWidth(view_column);
-
// NOTE: to be valid, we cannot use e.g. INT_MAX - 1
/*#define MAX_VIRTUAL_WIDTH 100000
// NOTE: to be valid, we cannot use e.g. INT_MAX - 1
/*#define MAX_VIRTUAL_WIDTH 100000
SortPrepare();
g_model->Resort();
SortPrepare();
g_model->Resort();
+ GetOwner()->InvalidateColBestWidth(view_column);
+
// Send event
wxWindow *parent = GetParent();
wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId());
// Send event
wxWindow *parent = GetParent();
wxDataViewEvent le(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, parent->GetId());
bool wxDataViewMainWindow::Cleared()
{
bool wxDataViewMainWindow::Cleared()
{
- GetOwner()->InvalidateColBestWidths();
-
DestroyTree();
m_selection.Clear();
SortPrepare();
BuildTree( GetOwner()->GetModel() );
DestroyTree();
m_selection.Clear();
SortPrepare();
BuildTree( GetOwner()->GetModel() );
+ GetOwner()->InvalidateColBestWidths();
UpdateDisplay();
return true;
UpdateDisplay();
return true;