Index: src/ch/FolderDialog.cpp =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) @@ -1,23 +1,21 @@ -/************************************************************************ - Copy Handler 1.x - program for copying data in Microsoft Windows - systems. - Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*************************************************************************/ - +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ #include "stdafx.h" #include "ch.h" #include "DirTreeCtrl.h" @@ -149,7 +147,7 @@ // CFolderDialog dialog CFolderDialog::CFolderDialog(CWnd* /*pParent*/ /*=NULL*/) - : CHLanguageDialog() + :ictranslate::CLanguageDialog() { //{{AFX_DATA_INIT(CFolderDialog) //}}AFX_DATA_INIT @@ -163,7 +161,7 @@ { } -BEGIN_MESSAGE_MAP(CFolderDialog, CHLanguageDialog) +BEGIN_MESSAGE_MAP(CFolderDialog,ictranslate::CLanguageDialog) //{{AFX_MSG_MAP(CFolderDialog) ON_NOTIFY(LVN_ENDLABELEDIT, IDC_SHORTCUT_LIST, OnEndLabelEditShortcutList) ON_BN_CLICKED(IDC_ADDSHORTCUT_BUTTON, OnAddShortcut) @@ -382,7 +380,7 @@ // initialization of most important params - reading text, bitmaps BOOL CFolderDialog::OnInitDialog() { - CHLanguageDialog::OnInitDialog(); + CLanguageDialog::OnInitDialog(); // image list InitImageList(); @@ -528,7 +526,7 @@ m_bdData.cx=rcDlg.Width(); m_bdData.cy=rcDlg.Height(); - CHLanguageDialog::OnCancel(); + CLanguageDialog::OnCancel(); } /////////////////////////////////////////////////////////////////////////// @@ -568,7 +566,7 @@ m_bdData.cx=rcDlg.Width(); m_bdData.cy=rcDlg.Height(); - CHLanguageDialog::OnOK(); + CLanguageDialog::OnOK(); } /////////////////////////////////////////////////////////////////////////// @@ -578,7 +576,7 @@ if (!InitModalIndirect((LPCDLGTEMPLATE)__g_DlgTemplate)) return -1; else - return CHLanguageDialog::DoModal(); + return ictranslate::CLanguageDialog::DoModal(); } /////////////////////////////////////////////////////////////////////////// @@ -611,7 +609,7 @@ break; } - return CHLanguageDialog::WindowProc(message, wParam, lParam); + return ictranslate::CLanguageDialog::WindowProc(message, wParam, lParam); } ////////////////////////////////////////////////////////////////////////////// @@ -757,6 +755,9 @@ // sets text in comboboxex edit and updates icon void CFolderDialog::SetComboPath(LPCTSTR lpszPath) { + _ASSERTE(lpszPath); + if(!lpszPath) + return; // set current select to -1 m_bIgnoreTreeRefresh=true; m_ctlPath.SetCurSel(-1); @@ -1008,7 +1009,7 @@ // resize handling void CFolderDialog::OnSize(UINT nType, int cx, int cy) { - CHLanguageDialog::OnSize(nType, cx, cy); + CLanguageDialog::OnSize(nType, cx, cy); ResizeControls(cx, cy); InvalidateRect(&m_rcGripper); @@ -1245,7 +1246,7 @@ // hit testing in a gripper cause LRESULT CFolderDialog::OnNcHitTest(CPoint point) { - UINT uiRes=CHLanguageDialog::OnNcHitTest(point); + UINT uiRes=CLanguageDialog::OnNcHitTest(point); if (uiRes == HTCLIENT) { CRect rc; @@ -1277,6 +1278,9 @@ // opens choose folder dialog int BrowseForFolder(CFolderDialog::BROWSEDATA* pData, LPTSTR pszPath) { + _ASSERTE(pData && pszPath); + if(!pData || !pszPath) + return IDCANCEL; ASSERT(pData); ASSERT(pszPath); CFolderDialog dlg;