Use wxDCXXXChanger classes instead of manual SetXXX() calls

No real changes, but the code is slightly shorter, maybe more clear and
will be easier to maintain (because more difficult to break
accidentally) in the future.
This commit is contained in:
Vadim Zeitlin 2017-12-18 17:00:44 +01:00
parent aa7c99b275
commit de7fa05245

View File

@ -3156,13 +3156,11 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
if (useDrawFix)
{
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(wxBrush(GetBackgroundColour()));
wxDCPenChanger changePen(dc, *wxTRANSPARENT_PEN);
wxDCBrushChanger changeBrush(dc, GetBackgroundColour());
dc.DrawRectangle(0, topItemRect.GetY() - gap,
clientSize.GetWidth(), gap);
dc.SetPen(pen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
}
const int numCols = GetColumnCount();