Clone
ixen <ixen@copyhandler.com>
committed
on 09 Jun 09
Fixed some warnings.
LoggerImprovements + 5 more
src/ch/CustomCopyDlg.cpp (+3 -3)
376 376         // attributes
377 377         lvc.iSubItem=3;
378 378         lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRATTRIB_STRING);
379 379         lvc.cchTextMax=lstrlen(lvc.pszText);
380 380         lvc.cx=static_cast<int>(0.1*rc.Width());
381 381         m_ctlFilters.InsertColumn(5, &lvc);
382 382
383 383         // -attributes
384 384         lvc.iSubItem=4;
385 385         lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEATTRIB_STRING);
386 386         lvc.cchTextMax=lstrlen(lvc.pszText);
387 387         lvc.cx=static_cast<int>(0.1*rc.Width());
388 388         m_ctlFilters.InsertColumn(6, &lvc);
389 389
390 390         // refresh the entries in filters' list
391 391         m_ctlFilters.DeleteAllItems();
392 392         for (size_t i=0;i<m_ccData.m_afFilters.GetSize();i++)
393 393         {
394 394                 const CFileFilter* pFilter = m_ccData.m_afFilters.GetAt(i);
395 395                 if(pFilter)
396                           AddFilter(*pFilter, i);
  396                         AddFilter(*pFilter, (int)i);
397 397         }
398 398 }
399 399
400 400 void CCustomCopyDlg::OnAddDirectoryButton()
401 401 {
402 402         CString strPath;
403 403         if (BrowseForFolder(GetResManager().LoadString(IDS_BROWSE_STRING), &strPath))
404 404                 AddPath(strPath);
405 405 }
406 406
407 407 void CCustomCopyDlg::OnAddFilesButton()
408 408 {
409 409         CFileDialog dlg(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FILEDLGALLFILTER_STRING), this);
410 410         
411 411         TCHAR *pszBuffer=new TCHAR[65535];
412 412         memset(pszBuffer, 0, 65535*sizeof(TCHAR));
413 413         dlg.m_ofn.lpstrFile=pszBuffer;
414 414         dlg.m_ofn.nMaxFile=65535;
415 415
416 416         if (dlg.DoModal() == IDOK)
417 417         {
418 418                 // first element is the path
419 419                 CString strPath=pszBuffer;
420 420
421                   int iOffset=_tcslen(pszBuffer)+1;
  421                 int iOffset = (int)_tcslen(pszBuffer) + 1;
422 422                 
423 423                 // get filenames
424 424                 if (pszBuffer[iOffset] == _T('\0'))
425 425                         AddPath(strPath);
426 426                 else
427 427                 {
428 428                         if (strPath.Right(1) != _T("\\"))
429 429                                 strPath+=_T("\\");
430 430                         while (pszBuffer[iOffset] != _T('\0'))
431 431                         {
432 432                                 AddPath(strPath+CString(pszBuffer+iOffset));
433                                   iOffset+=_tcslen(pszBuffer+iOffset)+1;
  433                                 iOffset += (int)_tcslen(pszBuffer+iOffset) + 1;
434 434                         }
435 435                 }
436 436         }
437 437
438 438         // delete buffer
439 439         delete [] pszBuffer;
440 440 }
441 441
442 442 void CCustomCopyDlg::OnRemoveButton()
443 443 {
444 444         POSITION pos;
445 445         int iItem;
446 446         while (true)
447 447         {
448 448                 pos = m_ctlFiles.GetFirstSelectedItemPosition();
449 449                 if (pos == NULL)
450 450                         break;
451 451                 else
452 452                 {
453 453                         iItem=m_ctlFiles.GetNextSelectedItem(pos);