Get rid of unnecessary static casts
This commit is contained in:
@@ -2071,12 +2071,13 @@ wxTextCtrl* wxPropertyGrid::GetEditorTextCtrl() const
|
|||||||
if ( !wnd )
|
if ( !wnd )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ( wxDynamicCast(wnd, wxTextCtrl) )
|
wxTextCtrl* tc = wxDynamicCast(wnd, wxTextCtrl);
|
||||||
return wxStaticCast(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();
|
return cb->GetTextCtrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3130,11 +3130,10 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
|||||||
wxStatusBar* wxPropertyGrid::GetStatusBar()
|
wxStatusBar* wxPropertyGrid::GetStatusBar()
|
||||||
{
|
{
|
||||||
wxWindow* topWnd = ::wxGetTopLevelParent(this);
|
wxWindow* topWnd = ::wxGetTopLevelParent(this);
|
||||||
if ( wxDynamicCast(topWnd, wxFrame) )
|
wxFrame* frame = wxDynamicCast(topWnd, wxFrame);
|
||||||
|
if ( frame )
|
||||||
{
|
{
|
||||||
wxFrame* pFrame = wxStaticCast(topWnd, wxFrame);
|
return frame->GetStatusBar();
|
||||||
if ( pFrame )
|
|
||||||
return pFrame->GetStatusBar();
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -4456,7 +4455,6 @@ bool wxPropertyGrid::SelectProperty( wxPGPropArg id, bool focus )
|
|||||||
|
|
||||||
bool wxPropertyGrid::DoCollapse( wxPGProperty* p, bool sendEvents )
|
bool wxPropertyGrid::DoCollapse( wxPGProperty* p, bool sendEvents )
|
||||||
{
|
{
|
||||||
wxPGProperty* pwc = wxStaticCast(p, wxPGProperty);
|
|
||||||
wxPGProperty* selected = GetSelection();
|
wxPGProperty* selected = GetSelection();
|
||||||
|
|
||||||
// If active editor was inside collapsed section, then disable it
|
// 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;
|
bool prevDontCenterSplitter = m_pState->m_dontCenterSplitter;
|
||||||
m_pState->m_dontCenterSplitter = true;
|
m_pState->m_dontCenterSplitter = true;
|
||||||
|
|
||||||
bool res = m_pState->DoCollapse(pwc);
|
bool res = m_pState->DoCollapse(p);
|
||||||
|
|
||||||
if ( res )
|
if ( res )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user