From 40a33c46e31226cab8dff02b0a078214f60666ac Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 16 Jul 2006 20:41:48 +0000 Subject: [PATCH] Avoid trouble during initialisation & typo fix (patch #1523304). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datectlg.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index abcbacf408..3c90fb1cc5 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -574,9 +574,13 @@ void wxDatePickerCtrlGeneric::DoMoveWindow(int x, int y, int w, int h) wxSize wxDatePickerCtrlGeneric::DoGetBestSize() const { - int bh=m_btn->GetBestSize().y; - int eh=m_txt->GetBestSize().y; - return wxSize(DEFAULT_ITEM_WIDTH, bh > eh ? bh : eh); + if (m_btn && m_txt) + { + int bh=m_btn->GetBestSize().y; + int eh=m_txt->GetBestSize().y; + return wxSize(DEFAULT_ITEM_WIDTH, bh > eh ? bh : eh); + } + return wxSize(DEFAULT_ITEM_WIDTH,DEFAULT_ITEM_HEIGHT); } @@ -736,7 +740,7 @@ bool wxDatePickerCtrlGeneric::GetRange(wxDateTime *dt1, wxDateTime *dt2) const { if (dt1) *dt1 = m_cal->GetLowerDateLimit(); - if (dt1) + if (dt2) *dt2 = m_cal->GetUpperDateLimit(); return true; } -- 2.45.2