Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#15803 closed defect (fixed)

wxDataViewCtrl ClearColumns followed by AssociateModel asserts

Reported by: johnr Owned by:
Priority: normal Milestone:
Component: GUI-generic Version: dev-latest
Keywords: wxDataViewCtrl ClearColumns Cc:
Blocked By: Blocking:
Patch: yes

Description

ClearColumns() in src/generic/datavgen.cpp does not reset m_sortingColumnIdx.

Where a previous sort column index existed and m_sortingColumnIdx != wxNOT_FOUND
Using
ClearColumns() which calls m_cols.Clear()
then
AssociateModel( new model) calls via
BuildTree(model)
SortPrepare()
GetSortingColumn()
GetColumn(m_sortingColumnIdx) with the value set previously which is now invalid and therefore causes an assert accessing an invalid array index.

Patch sets m_sortingColumnIdx = wxNOT_FOUND in ClearColumns().

Attachments (1)

datavgen.patch download (382 bytes) - added by johnr 8 months ago.

Download all attachments as: .zip

Change History (3)

Changed 8 months ago by johnr

comment:1 Changed 8 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75533]) Reset sorting column index in generic wxDataViewCtrl when clearing columns.

Otherwise we could continue to use the now invalid index for sorting.

Closes #15803.

comment:2 Changed 8 months ago by VZ

(In [75534]) Reset sorting column index in generic wxDataViewCtrl when clearing columns.

Otherwise we could continue to use the now invalid index for sorting.

Closes #15803.

Note: See TracTickets for help on using tickets.