Some code refactoring

This commit is contained in:
2015-06-07 18:24:03 +03:00
parent dec3cecfdb
commit b23d11ae46
2 changed files with 16 additions and 15 deletions

View File

@@ -68,12 +68,12 @@ void MainFrame::OnbtnPathClick(wxCommandEvent &event) {
wxFileDialog dlgOpen(this, wxT("Открыть файл кроссворда"), wxEmptyString, wxEmptyString,
wxT("Файлы кроссворда (*.cross)|*.cross"), wxFD_OPEN|wxFD_FILE_MUST_EXIST);
if (dlgOpen.ShowModal() == wxID_CANCEL)
if ( dlgOpen.ShowModal() == wxID_CANCEL )
return;
// proceed loading the file chosen by the user;
// this can be done with e.g. wxWidgets input streams:
wxFileInputStream input_stream(dlgOpen.GetPath());
if (!input_stream.IsOk()) {
if ( !input_stream.IsOk() ) {
wxLogError(wxT("Cannot open file ")+dlgOpen.GetPath());
return;
}