Cast to wxFileProperty* only once

Result of wxDynamicCast can be used directly, no need to cast once again in case of success.
This commit is contained in:
Artur Wieczorek
2019-04-20 19:33:21 +02:00
parent 9e71598dd1
commit 2898e8136a

View File

@@ -1947,13 +1947,12 @@ bool wxDirProperty::DoSetAttribute( const wxString& name, wxVariant& value )
bool wxPGFileDialogAdapter::DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property )
{
wxFileProperty* fileProp = NULL;
wxString path;
int indFilter = -1;
if ( wxDynamicCast(property, wxFileProperty) )
wxFileProperty* fileProp = wxDynamicCast(property, wxFileProperty);
if ( fileProp )
{
fileProp = ((wxFileProperty*)property);
wxFileName filename = fileProp->GetValue().GetString();
path = filename.GetPath();
indFilter = fileProp->m_indFilter;