From 2b7248c444ba401a93d7f67629f9884f8562004d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 20 Feb 2017 15:20:16 +0100 Subject: [PATCH] Don't use confusing variable name in wxMSW wxSpinCtrl code Another small refactoring after 05b980aba1db842b9be77deae58af3bfffb92d1d, avoid using "effectiveBtnWidth" variable as the effective button width is actually always its real width, it's just the text effective width that is smaller due to the overlap. See #12297. --- src/msw/spinctrl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 06d70c140e..8f338820b1 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -345,18 +345,17 @@ bool wxSpinCtrl::Create(wxWindow *parent, // finally deal with the size, now that both windows are created and the // font is set const wxSize sizeBtn = wxSpinButton::DoGetBestSize(); - const int effectiveBtnWidth = sizeBtn.x - GetOverlap(); wxSize sizeCtrl(size); if ( sizeCtrl.x <= 0 ) { // DEFAULT_ITEM_WIDTH is the default width for the text control - sizeCtrl.x = FromDIP(DEFAULT_ITEM_WIDTH) + effectiveBtnWidth; + sizeCtrl.x = FromDIP(DEFAULT_ITEM_WIDTH) + sizeBtn.x - GetOverlap(); } - else if ( sizeCtrl.x <= effectiveBtnWidth ) + else if ( sizeCtrl.x <= sizeBtn.x ) { wxLogDebug(wxS("wxSpinCtrl \"%s\": initial width %d is too small, ") wxS("at least %d pixels needed."), - name, size.x, effectiveBtnWidth); + name, size.x, sizeBtn.x); } // adjust an invalid height for text control