From ce1f7f02c4a71b0fe56ef6647f52d16b1e3fe6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 2 Oct 2006 12:11:19 +0000 Subject: [PATCH] Fixed crash caused by A=B?C:D used for returning wxObject derived type. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/stdrend.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index 4b25de7700..5a78545902 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -167,9 +167,20 @@ void wxStdRenderer::DrawBackground(wxDC& dc, int WXUNUSED(flags), wxWindow *window) { - wxColour colBg = col.Ok() ? col - : window ? m_scheme->GetBackground(window) - : wxSCHEME_COLOUR(m_scheme, CONTROL); + wxColour colBg; + + if (col.Ok()) + { + colBg = col; + } + else if (window) + { + colBg = m_scheme->GetBackground(window); + } + else + { + colBg = wxSCHEME_COLOUR(m_scheme, CONTROL); + } DrawSolidRect(dc, colBg, rect); }