# HG changeset patch # User pyon@macmini # Date 1390991342 -32400 # Node ID 593c93e904b5ef0a9a5581c78903ff81bc98268c # Parent ebc42d7a0010d0935ff2fa8d5862c114857d8f6b Fix bugs. diff -r ebc42d7a0010 -r 593c93e904b5 myframe.cpp --- a/myframe.cpp Fri Jan 24 20:35:59 2014 +0900 +++ b/myframe.cpp Wed Jan 29 19:29:02 2014 +0900 @@ -1,5 +1,5 @@ // Filename : myframe.cpp -// Last Change: 24-Jan-2014. +// Last Change: 29-Jan-2014. // #include "myframe.h" @@ -197,6 +197,10 @@ else if ( ext.IsSameAs( wxT("bmp"), false ) ) in_type = wxBITMAP_TYPE_BMP; else if ( ext.IsSameAs( wxT("tif"), false ) ) in_type = wxBITMAP_TYPE_TIFF; else if ( ext.IsSameAs( wxT("tiff"), false ) ) in_type = wxBITMAP_TYPE_TIFF; + else { + WarnMessage( wxT("Input file type is not supported !") ); + return false; + } int out_type = in_type; if ( choice_type == 1 ) { @@ -280,7 +284,7 @@ wxArrayString files; wxDir::GetAllFiles( dir, &files, wxT("*.*"), wxDIR_DEFAULT ); - for ( int i = 0; i < files.GetCount(); i++ ) { + for ( long i = 0; i < files.GetCount(); i++ ) { wxFileName fn( files[i] ); wxString in_ext = fn.GetExt(); @@ -295,6 +299,7 @@ else if ( in_ext.IsSameAs( wxT("bmp"), false ) ) in_type = wxBITMAP_TYPE_BMP; else if ( in_ext.IsSameAs( wxT("tif"), false ) ) in_type = wxBITMAP_TYPE_TIFF; else if ( in_ext.IsSameAs( wxT("tiff"), false ) ) in_type = wxBITMAP_TYPE_TIFF; + else continue; if ( out_type == wxBITMAP_TYPE_INVALID ) out_type = in_type;