Opened 5 years ago

Closed 5 years ago

#12025 closed defect (fixed)

wxDataViewVirtualListModel calls super-class' version of certain virtual methods

Reported by: HansR Owned by:
Priority: normal Milestone: 2.9.1
Component: GUI-all Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

WxDataViewVirtualListModel calls the super-class' version of virtual methods associated with data model changed (e.g., ItemUpdated()). For example, it does the following:
void wxDataViewVirtualListModel::RowValueChanged( unsigned int row, unsigned int col )
{

wxDataViewMode::ValueChanged( GetItem(row), col );

}

instead of:
void wxDataViewVirtualListModel::RowValueChanged( unsigned int row, unsigned int col )
{

ValueChanged( GetItem(row), col );

}

As a result, child-classes can't override these methods with custom implementations. Unless there is a VERY good reason why this is done, these should all be changed so that it uses the overridden version (there's no point in making the methods virtual otherwise).

Attachments (1)

wxDataViewVirtualListModel.diff download (1.2 KB) - added by HansR 5 years ago.
A patch with the required changes

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by HansR

A patch with the required changes

comment:1 Changed 5 years ago by HansR

Note: There are several methods that do this, not just the one in the example above.

comment:2 Changed 5 years ago by vadz

  • Milestone set to 2.9.1
  • Status changed from new to confirmed

I agree with this patch as the current code just doesn't make sense to me but then there are so many things in wxDVC which don't that I'm not sure that I'm not missing something.

If anybody objects to this patch/can explain why is the current code written like this, please let me know. Otherwise I'll apply this patch soon.

Thanks Hans!

comment:3 Changed 5 years ago by RR

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

(In [64320]) Don't call super class explicitly so overriding is possible, closes #12025 (wxDataViewVirtualListModel calls super-class' version of certain virtual methods).

Note: See TracTickets for help on using tickets.