Remove redundant conditionals
This commit is contained in:
@@ -161,10 +161,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
|
||||
y = (*max_y - poem_height)/2;
|
||||
width = *max_x;
|
||||
height = *max_y;
|
||||
}
|
||||
|
||||
if (DrawIt)
|
||||
{
|
||||
dc->SetBrush(*wxLIGHT_GREY_BRUSH);
|
||||
dc->SetPen(*wxGREY_PEN);
|
||||
dc->DrawRectangle(0, 0, width, height);
|
||||
|
@@ -4099,15 +4099,6 @@ gboolean wxDataViewCtrlInternal::iter_children( GtkTreeIter *iter, GtkTreeIter *
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iter == NULL)
|
||||
{
|
||||
if (m_root->GetChildCount() == 0) return FALSE;
|
||||
iter->stamp = m_gtk_model->stamp;
|
||||
iter->user_data = (gpointer) m_root->GetChildren().Item( 0 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
wxDataViewItem item;
|
||||
if (parent)
|
||||
item = wxDataViewItem( (void*) parent->user_data );
|
||||
|
@@ -781,7 +781,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
||||
|
||||
const wxBitmap* itemBitmap = NULL;
|
||||
|
||||
if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 )
|
||||
if ( choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 )
|
||||
itemBitmap = &choices.Item(item).GetBitmap();
|
||||
|
||||
//
|
||||
@@ -853,7 +853,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
||||
// image will not appear on the control row (it may be too
|
||||
// large to fit, for instance). Also do not draw custom image
|
||||
// if no choice was selected.
|
||||
if ( !p->HasFlag(wxPG_PROP_CUSTOMIMAGE) || item < 0 )
|
||||
if ( !p->HasFlag(wxPG_PROP_CUSTOMIMAGE) )
|
||||
useCustomPaintProcedure = false;
|
||||
}
|
||||
else
|
||||
@@ -897,13 +897,9 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
||||
renderer->Render( dc, r, this, p, m_selColumn, comValIndex, renderFlags );
|
||||
return;
|
||||
}
|
||||
else if ( item >= 0 )
|
||||
{
|
||||
p->OnCustomPaint( dc, r, paintdata );
|
||||
}
|
||||
else
|
||||
{
|
||||
dc.DrawRectangle( r );
|
||||
p->OnCustomPaint( dc, r, paintdata );
|
||||
}
|
||||
|
||||
pt.x += paintdata.m_drawnWidth + wxCC_CUSTOM_IMAGE_MARGIN2 - 1;
|
||||
@@ -915,10 +911,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
|
||||
// sure if it is needed, but seems to not cause any harm.
|
||||
pt.x -= 1;
|
||||
|
||||
if ( item < 0 && (flags & wxODCB_PAINTING_CONTROL) )
|
||||
item = pCb->GetSelection();
|
||||
|
||||
if ( choices.IsOk() && item >= 0 && comValIndex < 0 )
|
||||
if ( choices.IsOk() && comValIndex < 0 )
|
||||
{
|
||||
// This aligns bitmap horizontally so that it is
|
||||
// on the same position as bitmap drawn for static content
|
||||
|
@@ -2737,7 +2737,7 @@ long wxRichTextCtrl::FindNextWordPosition(int direction) const
|
||||
|
||||
if (text.empty()) // End of paragraph, or maybe an image
|
||||
return wxMax(-1, i - 1);
|
||||
else if (wxRichTextCtrlIsWhitespace(text) || text.empty())
|
||||
else if (wxRichTextCtrlIsWhitespace(text))
|
||||
i += direction;
|
||||
else
|
||||
{
|
||||
@@ -5407,10 +5407,7 @@ void wxRichTextCaret::DoSize()
|
||||
{
|
||||
m_countVisible = 0;
|
||||
DoHide();
|
||||
}
|
||||
|
||||
if (countVisible > 0)
|
||||
{
|
||||
m_countVisible = countVisible;
|
||||
DoShow();
|
||||
}
|
||||
|
Reference in New Issue
Block a user