Mercurial > mercurial > hgweb_imcv.cgi
changeset 1:593c93e904b5
Fix bugs.
author | pyon@macmini |
---|---|
date | Wed, 29 Jan 2014 19:29:02 +0900 |
parents | ebc42d7a0010 |
children | 25a76c128804 |
files | myframe.cpp |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;