diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index b0b38c70a4..586714235c 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -2071,12 +2071,13 @@ wxTextCtrl* wxPropertyGrid::GetEditorTextCtrl() const if ( !wnd ) return NULL; - if ( wxDynamicCast(wnd, wxTextCtrl) ) - return wxStaticCast(wnd, wxTextCtrl); + wxTextCtrl* tc = wxDynamicCast(wnd, wxTextCtrl); + if ( tc ) + return tc; - if ( wxDynamicCast(wnd, wxOwnerDrawnComboBox) ) + wxOwnerDrawnComboBox* cb = wxDynamicCast(wnd, wxOwnerDrawnComboBox); + if ( cb ) { - wxOwnerDrawnComboBox* cb = wxStaticCast(wnd, wxOwnerDrawnComboBox); return cb->GetTextCtrl(); } diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 84f93031ac..64ec7b55ff 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3130,11 +3130,10 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue wxStatusBar* wxPropertyGrid::GetStatusBar() { wxWindow* topWnd = ::wxGetTopLevelParent(this); - if ( wxDynamicCast(topWnd, wxFrame) ) + wxFrame* frame = wxDynamicCast(topWnd, wxFrame); + if ( frame ) { - wxFrame* pFrame = wxStaticCast(topWnd, wxFrame); - if ( pFrame ) - return pFrame->GetStatusBar(); + return frame->GetStatusBar(); } return NULL; } @@ -4456,7 +4455,6 @@ bool wxPropertyGrid::SelectProperty( wxPGPropArg id, bool focus ) bool wxPropertyGrid::DoCollapse( wxPGProperty* p, bool sendEvents ) { - wxPGProperty* pwc = wxStaticCast(p, wxPGProperty); wxPGProperty* selected = GetSelection(); // If active editor was inside collapsed section, then disable it @@ -4469,7 +4467,7 @@ bool wxPropertyGrid::DoCollapse( wxPGProperty* p, bool sendEvents ) bool prevDontCenterSplitter = m_pState->m_dontCenterSplitter; m_pState->m_dontCenterSplitter = true; - bool res = m_pState->DoCollapse(pwc); + bool res = m_pState->DoCollapse(p); if ( res ) {