X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d841efd46b5431b0fc272e87e2501cbeec30e6c..702723413ed52b1f538d9c8deab8abfa3f8beb9a:/samples/db/dbtest.cpp?ds=sidebyside diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp index 95d9b392ea..dbae3482f0 100644 --- a/samples/db/dbtest.cpp +++ b/samples/db/dbtest.cpp @@ -839,13 +839,17 @@ DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title, pEditorDlg = NULL; pParamDlg = NULL; +#if wxUSE_LOG delete wxLog::SetActiveTarget(new wxLogStderr); +#endif // wxUSE_LOG } // DatabaseDemoFrame constructor DatabaseDemoFrame::~DatabaseDemoFrame() { +#if wxUSE_LOG delete wxLog::SetActiveTarget(NULL); +#endif // wxUSE_LOG } // DatabaseDemoFrame destructor @@ -1571,7 +1575,7 @@ bool CeditorDlg::Initialize() choice_strings[3] = wxT("Spanish"); choice_strings[4] = wxT("Other"); - pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE, wxPoint( 17, 346), wxSize(277, wxDefaultSize.y), 5, choice_strings); + pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE, wxPoint( 17, 346), wxSize(277, wxDefaultCoord), 5, choice_strings); pNativeLangMsg = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG, wxT("Native language:"), wxPoint( 17, 330), wxDefaultSize, 0, wxT("NativeLangMsg")); wxString radio_strings[2]; @@ -2223,21 +2227,17 @@ void CparameterDlg::FillDataSourceList() { wxChar Dsn[SQL_MAX_DSN_LENGTH + 1]; wxChar DsDesc[255]; - wxStringList strList; + wxSortedArrayString strArr; while (wxDbGetDataSource(wxGetApp().DbConnectInf->GetHenv(), Dsn, SQL_MAX_DSN_LENGTH+1, DsDesc, 255)) - strList.Add(Dsn); - - strList.Sort(); - strList.Add(wxT("")); + { + strArr.Add(Dsn); + } - wxString current; - for (wxStringList::Node *node = strList.GetFirst(); node; node = node->GetNext() ) + for (size_t i=0; i < strArr.GetCount(); i++ ) { - current = node->GetData(); - if(!current.IsEmpty()) - pParamODBCSourceList->Append(current.c_str()); + pParamODBCSourceList->Append(strArr[i].c_str()); } } // CparameterDlg::FillDataSourceList()