From 18e03af068341bbb686eb9260245b98dc491805b Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Dec 2018 09:35:43 +0100 Subject: [PATCH] Use conditional operator instead of conditional statement --- src/propgrid/propgrid.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 02846d77cf..5536e43416 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2284,10 +2284,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, else if ( isPgEnabled ) { rowFgCol = m_colPropFore; - if ( p == firstSelected ) - rowBgCol = m_colMargin; - else - rowBgCol = selBackCol; + rowBgCol = p == firstSelected ? m_colMargin : selBackCol; } else { @@ -2440,10 +2437,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc, { dc.SetBrush(m_colPropBack); dc.SetPen(m_colPropBack); - if ( p->IsEnabled() ) - dc.SetTextForeground(m_colPropFore); - else - dc.SetTextForeground(m_colDisPropFore); + dc.SetTextForeground(p->IsEnabled() ? m_colPropFore : m_colDisPropFore); } } else