X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5acec1124566f6e3c16e29f1c29c4ff5e1b88d3a..ee6c519a4b1c8e919c1353b977e6396a160bc4b3:/src/msw/fdrepdlg.cpp diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index c1f7176452..d185b884c3 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -91,7 +91,7 @@ private: // registered Message for Dialog static UINT ms_msgFindDialog; - DECLARE_NO_COPY_CLASS(wxFindReplaceDialogImpl) + wxDECLARE_NO_COPY_CLASS(wxFindReplaceDialogImpl); }; UINT wxFindReplaceDialogImpl::ms_msgFindDialog = 0; @@ -114,7 +114,7 @@ wxFindReplaceDialogImpl::wxFindReplaceDialogImpl(wxFindReplaceDialog *dialog, if ( !ms_msgFindDialog ) { - wxLogLastError(_T("RegisterWindowMessage(FINDMSGSTRING)")); + wxLogLastError(wxT("RegisterWindowMessage(FINDMSGSTRING)")); } wxWindow::MSWRegisterMessageHandler @@ -210,14 +210,14 @@ wxFindReplaceDialogImpl::FindMessageHandler(wxWindow * WXUNUSED(win), static bool s_blockMsg = false; #endif // wxUSE_UNICODE_MSLU - wxASSERT_MSG( nMsg == ms_msgFindDialog, _T("unexpected message received") ); + wxASSERT_MSG( nMsg == ms_msgFindDialog, wxT("unexpected message received") ); FINDREPLACE *pFR = (FINDREPLACE *)lParam; #if wxUSE_UNICODE_MSLU // This is a hack for a MSLU problem: Versions up to 1.0.4011 // of UNICOWS.DLL send the correct UNICODE item after button press - // and a bogus ANSI mode item right after this, so lets ignore + // and a bogus ANSI mode item right after this, so let's ignore // the second bogus message if ( wxUsingUnicowsDll() && s_lastMsgFlags == pFR->Flags ) { @@ -260,7 +260,7 @@ wxFindReplaceDialogImpl::FindMessageHandler(wxWindow * WXUNUSED(win), } else { - wxFAIL_MSG( _T("unknown find dialog event") ); + wxFAIL_MSG( wxT("unknown find dialog event") ); return 0; } @@ -310,7 +310,7 @@ wxFindReplaceDialogHookProc(HWND hwnd, FINDREPLACE *pFR = (FINDREPLACE *)lParam; wxFindReplaceDialog *dialog = (wxFindReplaceDialog *)pFR->lCustData; - ::SetWindowText(hwnd, dialog->GetTitle()); + ::SetWindowText(hwnd, dialog->GetTitle().t_str()); // don't return FALSE from here or the dialog won't be shown return TRUE; @@ -349,20 +349,23 @@ wxFindReplaceDialog::wxFindReplaceDialog(wxWindow *parent, wxFindReplaceDialog::~wxFindReplaceDialog() { - // the dialog might have been already deleted if the user closed it - // manually but in this case we should have got a notification about it and - // the flagmust have been set - if ( !m_impl->WasClosedByUser() ) + if ( m_impl ) { - // if it wasn't, delete the dialog ourselves - if ( !::DestroyWindow(GetHwnd()) ) + // the dialog might have been already deleted if the user closed it + // manually but in this case we should have got a notification about it + // and the flag must have been set + if ( !m_impl->WasClosedByUser() ) { - wxLogLastError(_T("DestroyWindow(find dialog)")); + // if it wasn't, delete the dialog ourselves + if ( !::DestroyWindow(GetHwnd()) ) + { + wxLogLastError(wxT("DestroyWindow(find dialog)")); + } } - } - // unsubclass the parent - delete m_impl; + // unsubclass the parent + delete m_impl; + } // prevent the base class dtor from trying to hide us! m_isShown = false; @@ -413,9 +416,9 @@ bool wxFindReplaceDialog::Show(bool show) return true; } - wxCHECK_MSG( m_FindReplaceData, false, _T("call Create() first!") ); + wxCHECK_MSG( m_FindReplaceData, false, wxT("call Create() first!") ); - wxASSERT_MSG( !m_impl, _T("why don't we have the window then?") ); + wxASSERT_MSG( !m_impl, wxT("why don't we have the window then?") ); m_impl = new wxFindReplaceDialogImpl(this, m_FindReplaceData->GetFlags()); @@ -440,15 +443,14 @@ bool wxFindReplaceDialog::Show(bool show) wxLogError(_("Failed to create the standard find/replace dialog (error code %d)"), ::CommDlgExtendedError()); - delete m_impl; - m_impl = NULL; + wxDELETE(m_impl); return false; } if ( !::ShowWindow(hwnd, SW_SHOW) ) { - wxLogLastError(_T("ShowWindow(find dialog)")); + wxLogLastError(wxT("ShowWindow(find dialog)")); } m_hWnd = (WXHWND)hwnd;