Don't test if a reference is null, this cannot happen.

Testing for null references is unnecessary and just results in clang warnings.

Closes #17016.
This commit is contained in:
Jan van Dijk
2015-06-03 17:08:30 +02:00
committed by Vadim Zeitlin
parent 09e1223d2e
commit 72a4c3a4d0
4 changed files with 5 additions and 16 deletions

View File

@@ -683,8 +683,6 @@ void wxAuiDefaultDockArt::DrawPaneButton(wxDC& dc, wxWindow *WXUNUSED(window),
wxAuiPaneInfo& pane) wxAuiPaneInfo& pane)
{ {
wxBitmap bmp; wxBitmap bmp;
if (!(&pane))
return;
switch (button) switch (button)
{ {
default: default:

View File

@@ -947,10 +947,7 @@ wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxS
gs_cp_es_syscolour_values, gs_cp_es_syscolour_values,
&gs_wxSystemColourProperty_choicesCache ) &gs_wxSystemColourProperty_choicesCache )
{ {
if ( &value )
Init( value.m_type, value.m_colour ); Init( value.m_type, value.m_colour );
else
Init( wxPG_COLOUR_CUSTOM, *wxWHITE );
} }
@@ -959,10 +956,7 @@ wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxS
const wxColourPropertyValue& value ) const wxColourPropertyValue& value )
: wxEnumProperty( label, name, labels, values, choicesCache ) : wxEnumProperty( label, name, labels, values, choicesCache )
{ {
if ( &value )
Init( value.m_type, value.m_colour ); Init( value.m_type, value.m_colour );
else
Init( wxPG_COLOUR_CUSTOM, *wxWHITE );
} }
@@ -971,10 +965,7 @@ wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxS
const wxColour& value ) const wxColour& value )
: wxEnumProperty( label, name, labels, values, choicesCache ) : wxEnumProperty( label, name, labels, values, choicesCache )
{ {
if ( &value )
Init( wxPG_COLOUR_CUSTOM, value ); Init( wxPG_COLOUR_CUSTOM, value );
else
Init( wxPG_COLOUR_CUSTOM, *wxWHITE );
} }
@@ -2063,7 +2054,7 @@ wxArrayInt wxMultiChoiceProperty::GetValueAsIndices() const
// Translate values to string indices. // Translate values to string indices.
wxArrayInt selections; wxArrayInt selections;
if ( !m_choices.IsOk() || !m_choices.GetCount() || !(&valueArr) ) if ( !m_choices.IsOk() || !m_choices.GetCount() )
{ {
for ( i=0; i<valueArr.size(); i++ ) for ( i=0; i<valueArr.size(); i++ )
selections.Add(-1); selections.Add(-1);

View File

@@ -2145,7 +2145,7 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp )
delete m_valueBitmap; delete m_valueBitmap;
if ( &bmp && bmp.IsOk() ) if ( bmp.IsOk() )
{ {
// Resize the image // Resize the image
wxSize maxSz = GetGrid()->GetImageSize(); wxSize maxSz = GetGrid()->GetImageSize();
@@ -3043,7 +3043,7 @@ wxArrayString wxPGChoices::GetLabels() const
{ {
wxArrayString arr; wxArrayString arr;
if ( this && IsOk() ) if ( IsOk() )
for ( unsigned int i = 0; i < GetCount(); i++ ) for ( unsigned int i = 0; i < GetCount(); i++ )
arr.push_back(GetLabel(i)); arr.push_back(GetLabel(i));

View File

@@ -1201,7 +1201,7 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name,
{ {
SetIndex(0); SetIndex(0);
if ( &labels && !labels.empty() ) if ( !labels.empty() )
{ {
m_choices.Set(labels, values); m_choices.Set(labels, values);
@@ -1590,7 +1590,7 @@ wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
{ {
m_oldChoicesData = NULL; m_oldChoicesData = NULL;
if ( &labels && !labels.empty() ) if ( !labels.empty() )
{ {
m_choices.Set(labels,values); m_choices.Set(labels,values);