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:
@@ -1947,13 +1947,12 @@ bool wxDirProperty::DoSetAttribute( const wxString& name, wxVariant& value )
|
|||||||
|
|
||||||
bool wxPGFileDialogAdapter::DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property )
|
bool wxPGFileDialogAdapter::DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty* property )
|
||||||
{
|
{
|
||||||
wxFileProperty* fileProp = NULL;
|
|
||||||
wxString path;
|
wxString path;
|
||||||
int indFilter = -1;
|
int indFilter = -1;
|
||||||
|
|
||||||
if ( wxDynamicCast(property, wxFileProperty) )
|
wxFileProperty* fileProp = wxDynamicCast(property, wxFileProperty);
|
||||||
|
if ( fileProp )
|
||||||
{
|
{
|
||||||
fileProp = ((wxFileProperty*)property);
|
|
||||||
wxFileName filename = fileProp->GetValue().GetString();
|
wxFileName filename = fileProp->GetValue().GetString();
|
||||||
path = filename.GetPath();
|
path = filename.GetPath();
|
||||||
indFilter = fileProp->m_indFilter;
|
indFilter = fileProp->m_indFilter;
|
||||||
|
Reference in New Issue
Block a user