Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.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 "resource.h" #include "CustomCopyDlg.h" @@ -38,7 +36,7 @@ // CCustomCopyDlg dialog -CCustomCopyDlg::CCustomCopyDlg() : CHLanguageDialog(CCustomCopyDlg::IDD) +CCustomCopyDlg::CCustomCopyDlg() :ictranslate::CLanguageDialog(CCustomCopyDlg::IDD) { //{{AFX_DATA_INIT(CCustomCopyDlg) m_ucCount = 1; @@ -68,7 +66,7 @@ void CCustomCopyDlg::DoDataExchange(CDataExchange* pDX) { - CHLanguageDialog::DoDataExchange(pDX); + CLanguageDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CCustomCopyDlg) DDX_Control(pDX, IDC_DESTPATH_COMBOBOXEX, m_ctlDstPath); DDX_Control(pDX, IDC_COUNT_SPIN, m_ctlCountSpin); @@ -88,7 +86,7 @@ } -BEGIN_MESSAGE_MAP(CCustomCopyDlg, CHLanguageDialog) +BEGIN_MESSAGE_MAP(CCustomCopyDlg,ictranslate::CLanguageDialog) //{{AFX_MSG_MAP(CCustomCopyDlg) ON_BN_CLICKED(IDC_ADDDIR_BUTTON, OnAddDirectoryButton) ON_BN_CLICKED(IDC_ADDFILE_BUTTON, OnAddFilesButton) @@ -114,7 +112,7 @@ // CCustomCopyDlg message handlers BOOL CCustomCopyDlg::OnInitDialog() { - CHLanguageDialog::OnInitDialog(); + CLanguageDialog::OnInitDialog(); // make this dialog on top SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); @@ -259,7 +257,7 @@ return TRUE; } -void CCustomCopyDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +void CCustomCopyDlg::OnLanguageChanged() { UpdateData(TRUE); @@ -450,7 +448,7 @@ if (m_ccData.m_strDestPath.IsEmpty() || m_ccData.m_astrPaths.GetSize() == 0) MsgBox(IDS_MISSINGDATA_STRING); else - CHLanguageDialog::OnOK(); + CLanguageDialog::OnOK(); } void CCustomCopyDlg::SetBuffersizesString() @@ -590,7 +588,7 @@ if (rFilter.m_bUseSize) { _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(static_cast<__int64>(rFilter.m_ullSize1), szData, true)); - + szLoaded[1023] = _T('\0'); if (rFilter.m_bUseSize2) { _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); @@ -612,6 +610,7 @@ if (rFilter.m_bUseDate) { _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_DATECREATED_STRING+rFilter.m_iDateType), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iDateType1)); + szLoaded[1023] = _T('\0'); if (rFilter.m_bDate1) _tcscat(szLoaded, rFilter.m_tDate1.Format(_T(" %x"))); if (rFilter.m_bTime1) @@ -706,7 +705,7 @@ m_ctlFiles.SetImageList(NULL, LVSIL_SMALL); m_ilImages.Detach(); - CHLanguageDialog::OnDestroy(); + CLanguageDialog::OnDestroy(); } void CCustomCopyDlg::EnableControls() @@ -792,6 +791,10 @@ void CCustomCopyDlg::SetComboPath(LPCTSTR lpszText) { + _ASSERTE(lpszText); + if(!lpszText) + return; + // set current select to -1 m_ctlDstPath.SetCurSel(-1); @@ -815,6 +818,7 @@ // get text from combo COMBOBOXEXITEM cbi; TCHAR szPath[_MAX_PATH]; + memset(szPath, 0, _MAX_PATH); cbi.mask=CBEIF_TEXT; cbi.iItem=m_ctlDstPath.GetCurSel()/*-1*/; cbi.pszText=szPath;