Merge branch 'dvc-delete-all'

Fix crashes when deleting all items from wxTreeListCtrl in wxGTK3.

See https://github.com/wxWidgets/wxWidgets/pull/683

Closes #18045.
This commit is contained in:
Vadim Zeitlin
2018-01-25 19:39:55 +01:00
5 changed files with 81 additions and 40 deletions

View File

@@ -188,6 +188,25 @@ public:
int GTKGetUniformRowHeight() const { return m_uniformRowHeight; }
// Simple RAII helper for disabling selection events during its lifetime.
class SelectionEventsSuppressor
{
public:
explicit SelectionEventsSuppressor(wxDataViewCtrl* ctrl)
: m_ctrl(ctrl)
{
m_ctrl->GtkDisableSelectionEvents();
}
~SelectionEventsSuppressor()
{
m_ctrl->GtkEnableSelectionEvents();
}
private:
wxDataViewCtrl* const m_ctrl;
};
protected:
virtual void DoSetExpanderColumn() wxOVERRIDE;
virtual void DoSetIndent() wxOVERRIDE;