From 8571cfed2f27f9b6483549e7012e08a97b2edf5a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2019 22:11:15 +0100 Subject: [PATCH] Remove unnecessary RECT initialization in WM_NCCALCSIZE handler No real changes, just make RECT (lack of) initialization before calling GetThemeBackgroundContentRect() consistent between WM_NCCALCSIZE and WM_NCPAINT handlers. See https://github.com/wxWidgets/wxWidgets/pull/1141 --- src/msw/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5da2ec427e..8ef8e639e3 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3729,7 +3729,12 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, } wxUxThemeHandle hTheme((const wxWindow *)this, L"EDIT"); - RECT rcClient = { 0, 0, 0, 0 }; + + // There is no need to initialize rcClient: either it will + // be done by GetThemeBackgroundContentRect() or we'll do + // it below if it fails. + RECT rcClient; + wxClientDC dc((wxWindow *)this); wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();