From d613fb75f6250351555c1e62dee96540bf1c73c3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 5 Mar 2016 18:43:55 +0100 Subject: [PATCH] Don't update if column width didn't change in generic wxDataViewCtrl Avoid calling UpdateDisplay() unnecessarily if the column width didn't really change. This doesn't result in anything really bad happening right now, but it could easily result in an infinite stream of updates if the code were only slightly different and it just seems useless to do it. --- include/wx/generic/dataview.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 6f89ee6165..27bdf1dc90 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -64,8 +64,11 @@ public: virtual void SetWidth(int width) wxOVERRIDE { - m_width = width; - UpdateDisplay(); + if ( width != m_width ) + { + m_width = width; + UpdateDisplay(); + } } virtual int GetWidth() const wxOVERRIDE;