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)
{
wxBitmap bmp;
if (!(&pane))
return;
switch (button)
{
default:

View File

@@ -947,10 +947,7 @@ wxSystemColourProperty::wxSystemColourProperty( const wxString& label, const wxS
gs_cp_es_syscolour_values,
&gs_wxSystemColourProperty_choicesCache )
{
if ( &value )
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 )
: wxEnumProperty( label, name, labels, values, choicesCache )
{
if ( &value )
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 )
: wxEnumProperty( label, name, labels, values, choicesCache )
{
if ( &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.
wxArrayInt selections;
if ( !m_choices.IsOk() || !m_choices.GetCount() || !(&valueArr) )
if ( !m_choices.IsOk() || !m_choices.GetCount() )
{
for ( i=0; i<valueArr.size(); i++ )
selections.Add(-1);

View File

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

View File

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