From baf965ef306e6269442c05d33afb874d2750be29 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 3 Jan 2015 12:52:05 +0100 Subject: [PATCH] Fix wxPGChoices::Set method. There is no need to check if referenced array with values is valid since "reference cannot be bound to dereferenced null pointer in well-defined C++ code". Moreover, conditional call of wxPGChoices::Add() methods (one with explicit parameter and one with default one) is not necessary. This is the backport of r78343. See #16759 (http://trac.wxwidgets.org/ticket/16759). --- include/wx/propgrid/property.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index a23d1ddf12..bc61848413 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -1050,10 +1050,7 @@ public: const wxArrayInt& values = wxArrayInt() ) { Free(); - if ( &values ) - Add(labels,values); - else - Add(labels); + Add(labels,values); } // Creates exclusive copy of current choices