Index: src/ch/AppHelper.cpp =================================================================== diff -u -r4213a6bbd2b543810d29c5a1964917903055d60c -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision 4213a6bbd2b543810d29c5a1964917903055d60c) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -75,7 +75,7 @@ // path UINT uiSize=(UINT)(pszName-pszArgv); - m_pszProgramPath=new TCHAR[uiSize+1]; + m_pszProgramPath=new TCHAR[uiSize+1]; _tcsncpy(m_pszProgramPath, pszArgv, uiSize); m_pszProgramPath[uiSize]=_T('\0'); } Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -r22bbc4a87fa0b249e1e02ba385f28da9d77a4aa1 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 22bbc4a87fa0b249e1e02ba385f28da9d77a4aa1) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -168,8 +168,8 @@ SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); // paths' listbox - init images - system image list - SHFILEINFO sfi; - HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHFILEINFO sfi; + HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON); m_ilImages.Attach(hImageList); @@ -395,7 +395,7 @@ { const CFileFilter* pFilter = m_ccData.m_afFilters.GetAt(stIndex); if(pFilter) - AddFilter(*pFilter, boost::numeric_cast(stIndex)); + AddFilter(*pFilter, boost::numeric_cast(stIndex)); } } @@ -417,7 +417,7 @@ if(dlg.DoModal() == IDOK) { - pszBuffer[65534] = _T('\0'); + pszBuffer[65534] = _T('\0'); // first element is the path CString strPath=pszBuffer; @@ -821,9 +821,9 @@ BOOST_ASSERT(pFilter); if(pFilter) { - if(pFilter->m_bUseMask && boost::numeric_cast(stIndex) != iItem) + if(pFilter->m_bUseMask && boost::numeric_cast(stIndex) != iItem) dlg.m_astrAddMask.Add(pFilter->GetCombinedMask(strData)); - if (pFilter->m_bUseExcludeMask && boost::numeric_cast(stIndex) != iItem) + if (pFilter->m_bUseExcludeMask && boost::numeric_cast(stIndex) != iItem) dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask(strData)); } } @@ -957,7 +957,7 @@ return; } - ulong_t ulSize = boost::numeric_cast(llSize); + ulong_t ulSize = boost::numeric_cast(llSize); spBuffer.reset(new BYTE[ulSize + 3]); // guarantee that we have null at the end of the string (3 bytes to compensate for possible odd number of bytes and for unicode) memset(spBuffer.get(), 0, ulSize + 3); Index: src/ch/Device IO.h =================================================================== diff -u -r9352ed0c4fe447a36bc728640c307be6d41455fd -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/Device IO.h (.../Device IO.h) (revision 9352ed0c4fe447a36bc728640c307be6d41455fd) +++ src/ch/Device IO.h (.../Device IO.h) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -52,13 +52,13 @@ pszSignature=_tcsstr(szQuery.get() + dwOffset, _T("Signature")); if (pszSignature == NULL) { - dwOffset += boost::numeric_cast(_tcslen(szQuery.get() + dwOffset) + 1); + dwOffset += boost::numeric_cast(_tcslen(szQuery.get() + dwOffset) + 1); continue; } pszOffset=_tcsstr(pszSignature, _T("Offset")); if (pszOffset == NULL) { - dwOffset += boost::numeric_cast(_tcslen(szQuery.get() + dwOffset) + 1); + dwOffset += boost::numeric_cast(_tcslen(szQuery.get() + dwOffset) + 1); continue; } Index: src/ch/DirTreeCtrl.cpp =================================================================== diff -u -rb0f4dd77e1a90473424ac91bc31ad800e07a917f -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision b0f4dd77e1a90473424ac91bc31ad800e07a917f) +++ src/ch/DirTreeCtrl.cpp (.../DirTreeCtrl.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -32,170 +32,170 @@ LPITEMIDLIST Next(LPCITEMIDLIST pidl) { - LPSTR lpMem=(LPSTR)pidl; + LPSTR lpMem=(LPSTR)pidl; - lpMem+=pidl->mkid.cb; + lpMem+=pidl->mkid.cb; - return (LPITEMIDLIST)lpMem; + return (LPITEMIDLIST)lpMem; } UINT GetSize(LPCITEMIDLIST pidl) { - UINT cbTotal = 0; - if (pidl) - { - cbTotal += sizeof(pidl->mkid.cb); // Null terminator - while (pidl->mkid.cb) - { - cbTotal += pidl->mkid.cb; - pidl = Next(pidl); - } - } + UINT cbTotal = 0; + if (pidl) + { + cbTotal += sizeof(pidl->mkid.cb); // Null terminator + while (pidl->mkid.cb) + { + cbTotal += pidl->mkid.cb; + pidl = Next(pidl); + } + } - return cbTotal; + return cbTotal; } LPITEMIDLIST CreatePidl(UINT cbSize) { - LPMALLOC lpMalloc; - HRESULT hr; - LPITEMIDLIST pidl=NULL; + LPMALLOC lpMalloc; + HRESULT hr; + LPITEMIDLIST pidl=NULL; - hr=SHGetMalloc(&lpMalloc); + hr=SHGetMalloc(&lpMalloc); - if (FAILED(hr)) - return 0; + if (FAILED(hr)) + return 0; - pidl=(LPITEMIDLIST)lpMalloc->Alloc(cbSize); + pidl=(LPITEMIDLIST)lpMalloc->Alloc(cbSize); - if (pidl) - memset(pidl, 0, cbSize); // zero-init for external task alloc + if (pidl) + memset(pidl, 0, cbSize); // zero-init for external task alloc - if (lpMalloc) lpMalloc->Release(); + if (lpMalloc) lpMalloc->Release(); - return pidl; + return pidl; } void FreePidl(LPITEMIDLIST lpiidl) { - LPMALLOC lpMalloc; - HRESULT hr; + LPMALLOC lpMalloc; + HRESULT hr; - hr=SHGetMalloc(&lpMalloc); + hr=SHGetMalloc(&lpMalloc); - if (FAILED(hr)) - return; + if (FAILED(hr)) + return; - lpMalloc->Free(lpiidl); + lpMalloc->Free(lpiidl); - if (lpMalloc) lpMalloc->Release(); + if (lpMalloc) lpMalloc->Release(); } LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) { - LPITEMIDLIST pidlNew; - UINT cb1; - UINT cb2; + LPITEMIDLIST pidlNew; + UINT cb1; + UINT cb2; - if (pidl1) //May be NULL - cb1 = GetSize(pidl1) - sizeof(pidl1->mkid.cb); - else - cb1 = 0; + if (pidl1) //May be NULL + cb1 = GetSize(pidl1) - sizeof(pidl1->mkid.cb); + else + cb1 = 0; - cb2 = GetSize(pidl2); + cb2 = GetSize(pidl2); - pidlNew = CreatePidl(cb1 + cb2); - if (pidlNew) - { - if (pidl1) - memcpy(pidlNew, pidl1, cb1); - memcpy(((LPSTR)pidlNew) + cb1, pidl2, cb2); - } - return pidlNew; + pidlNew = CreatePidl(cb1 + cb2); + if (pidlNew) + { + if (pidl1) + memcpy(pidlNew, pidl1, cb1); + memcpy(((LPSTR)pidlNew) + cb1, pidl2, cb2); + } + return pidlNew; } LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi) { - LPITEMIDLIST lpiTemp; + LPITEMIDLIST lpiTemp; - lpiTemp=(LPITEMIDLIST)lpMalloc->Alloc(lpi->mkid.cb+sizeof(lpi->mkid.cb)); - CopyMemory((PVOID)lpiTemp, (CONST VOID *)lpi, lpi->mkid.cb+sizeof(lpi->mkid.cb)); + lpiTemp=(LPITEMIDLIST)lpMalloc->Alloc(lpi->mkid.cb+sizeof(lpi->mkid.cb)); + CopyMemory((PVOID)lpiTemp, (CONST VOID *)lpi, lpi->mkid.cb+sizeof(lpi->mkid.cb)); - return lpiTemp; + return lpiTemp; } BOOL GetName(LPSHELLFOLDER lpsf, - LPITEMIDLIST lpi, + LPITEMIDLIST lpi, DWORD dwFlags, - LPTSTR lpFriendlyName) + LPTSTR lpFriendlyName) { - BOOL bSuccess=TRUE; - STRRET str; + BOOL bSuccess=TRUE; + STRRET str; - if (NOERROR==lpsf->GetDisplayNameOf(lpi,dwFlags, &str)) - { - switch (str.uType) - { - case STRRET_WSTR: + if (NOERROR==lpsf->GetDisplayNameOf(lpi,dwFlags, &str)) + { + switch (str.uType) + { + case STRRET_WSTR: { CW2T cw2t(str.pOleStr); lstrcpy(lpFriendlyName, cw2t); break; } - case STRRET_OFFSET: - { - lstrcpy(lpFriendlyName, (LPTSTR)lpi+str.uOffset); - break; - } + case STRRET_OFFSET: + { + lstrcpy(lpFriendlyName, (LPTSTR)lpi+str.uOffset); + break; + } - case STRRET_CSTR: - { - CA2T ca2t(str.cStr); - lstrcpy(lpFriendlyName, ca2t); - break; - } + case STRRET_CSTR: + { + CA2T ca2t(str.cStr); + lstrcpy(lpFriendlyName, ca2t); + break; + } - default: - bSuccess = FALSE; - break; - } - } - else - bSuccess = FALSE; + default: + bSuccess = FALSE; + break; + } + } + else + bSuccess = FALSE; - return bSuccess; + return bSuccess; } LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi) { - TCHAR szBuff[MAX_PATH]; - LPSHELLFOLDER lpsfDeskTop; - LPITEMIDLIST lpifq; - ULONG ulEaten, ulAttribs; - HRESULT hr; + TCHAR szBuff[MAX_PATH]; + LPSHELLFOLDER lpsfDeskTop; + LPITEMIDLIST lpifq; + ULONG ulEaten, ulAttribs; + HRESULT hr; - if (!GetName(lpsf, lpi, SHGDN_FORPARSING, szBuff)) - return NULL; + if (!GetName(lpsf, lpi, SHGDN_FORPARSING, szBuff)) + return NULL; - hr=SHGetDesktopFolder(&lpsfDeskTop); + hr=SHGetDesktopFolder(&lpsfDeskTop); - if (FAILED(hr)) - return NULL; + if (FAILED(hr)) + return NULL; - CT2W ct2w(szBuff); - hr=lpsfDeskTop->ParseDisplayName(NULL, - NULL, - ct2w, - &ulEaten, - &lpifq, - &ulAttribs); + CT2W ct2w(szBuff); + hr=lpsfDeskTop->ParseDisplayName(NULL, + NULL, + ct2w, + &ulEaten, + &lpifq, + &ulAttribs); - lpsfDeskTop->Release(); + lpsfDeskTop->Release(); - if (FAILED(hr)) - return NULL; + if (FAILED(hr)) + return NULL; - return lpifq; + return lpifq; } ///////////////////////////////////////////////////////////////////////////// @@ -208,37 +208,8 @@ m_hImageList=NULL; m_bIgnore=false; m_iEditType=0; -// RegisterWindowClass(); } -/* -bool CDirTreeCtrl::RegisterWindowClass() -{ - WNDCLASS wndcls; - HINSTANCE hInst = AfxGetInstanceHandle(); - if (!(::GetClassInfo(hInst, DIRTREECTRL_CLASSNAME, &wndcls))) - { - // otherwise we need to register a new class - wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; - wndcls.lpfnWndProc = ::DefWindowProc; - wndcls.cbClsExtra = wndcls.cbWndExtra = 0; - wndcls.hInstance = hInst; - wndcls.hIcon = NULL; - wndcls.hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW); - wndcls.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1); - wndcls.lpszMenuName = NULL; - wndcls.lpszClassName = DIRTREECTRL_CLASSNAME; - - if (!AfxRegisterClass(&wndcls)) - { - AfxThrowResourceException(); - return false; - } - } - - return true; -} -*/ CDirTreeCtrl::~CDirTreeCtrl() { } @@ -282,8 +253,8 @@ void CDirTreeCtrl::InitControl() { // prepare image list - SHFILEINFO sfi; - m_hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHFILEINFO sfi; + m_hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON); TreeView_SetImageList(this->m_hWnd, m_hImageList, TVSIL_NORMAL); @@ -390,7 +361,7 @@ lpsf->Release(); - return (short)SCODE_CODE(GetScode(hRes)); + return (short)SCODE_CODE(GetScode(hRes)); } ///////////////////////////////////////////////////////////////////////////// Index: src/ch/FeedbackReplaceDlg.cpp =================================================================== diff -u -r22bbc4a87fa0b249e1e02ba385f28da9d77a4aa1 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision 22bbc4a87fa0b249e1e02ba385f28da9d77a4aa1) +++ src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -99,15 +99,15 @@ fmt.SetParam(_T("%filename"), m_spSrcFile->GetFullFilePath()); fmt.SetParam(_T("%size"), m_spSrcFile->GetLength64()); - COleDateTime dtTemp = m_spSrcFile->GetLastWriteTime(); + COleDateTime dtTemp = m_spSrcFile->GetLastWriteTime(); fmt.SetParam(_T("%datemod"), dtTemp.Format(LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT)); m_ctlSrcInfo.SetWindowText(fmt); fmt.SetFormat(strTemplate); fmt.SetParam(_T("%filename"), m_spDstFile->GetFullFilePath()); fmt.SetParam(_T("%size"), m_spDstFile->GetLength64()); - dtTemp = m_spDstFile->GetLastWriteTime(); + dtTemp = m_spDstFile->GetLastWriteTime(); fmt.SetParam(_T("%datemod"), dtTemp.Format(LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT)); m_ctlDstInfo.SetWindowText(fmt); Index: src/ch/FileInfo.cpp =================================================================== diff -u -r22573f5fa8bfbf68a19deb7631962e026f028045 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 22573f5fa8bfbf68a19deb7631962e026f028045) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -90,10 +90,10 @@ CString CClipboardEntry::GetFileName() const { - TCHAR szName[_MAX_FNAME]; - TCHAR szExt[_MAX_EXT]; - _tsplitpath(m_strPath, NULL, NULL, szName, szExt); - return CString(szName) + szExt; + TCHAR szName[_MAX_FNAME]; + TCHAR szExt[_MAX_EXT]; + _tsplitpath(m_strPath, NULL, NULL, szName, szExt); + return CString(szName) + szExt; } void CClipboardEntry::AddDestinationPath(const CString& strPath) @@ -295,12 +295,12 @@ void CFileInfo::Create(const WIN32_FIND_DATA* pwfd, LPCTSTR pszFilePath, size_t stSrcIndex) { BOOST_ASSERT(stSrcIndex == std::numeric_limits::max() || m_pClipboard); - if(stSrcIndex != std::numeric_limits::max() && !m_pClipboard) + if(stSrcIndex != std::numeric_limits::max() && !m_pClipboard) THROW(_t("Internal error: pointer not initialized."), 0, 0, 0); // copy data from W32_F_D m_strFilePath = CString(pszFilePath) + pwfd->cFileName; - + // if proper index has been passed - reduce the path if(m_pClipboard && stSrcIndex >= 0) m_strFilePath=m_strFilePath.Mid(m_pClipboard->GetAt(stSrcIndex)->GetPath().GetLength()); // cut path from clipboard Index: src/ch/FolderDialog.cpp =================================================================== diff -u -r9352ed0c4fe447a36bc728640c307be6d41455fd -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 9352ed0c4fe447a36bc728640c307be6d41455fd) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -458,7 +458,7 @@ sc = CString(m_bdData.cvShortcuts.at(stIndex)); sfi.iIcon = -1; SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); - m_ctlShortcuts.InsertItem(boost::numeric_cast(stIndex), sc.m_strName, sfi.iIcon); + m_ctlShortcuts.InsertItem(boost::numeric_cast(stIndex), sc.m_strName, sfi.iIcon); m_ctlShortcuts.SetItem(boost::numeric_cast(stIndex), 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); } Index: src/ch/MainWnd.cpp =================================================================== diff -u -r4a3c74a38b00e7793d1e61107a824060e6c2ea95 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 4a3c74a38b00e7793d1e61107a824060e6c2ea95) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -750,9 +750,9 @@ if(pszPath) cvShortcuts.push_back(pszPath); } - + // count of shortcuts to store - g_pscsShared->iShortcutsCount = boost::numeric_cast(std::min(cvShortcuts.size(), (SHARED_BUFFERSIZE - 5 * sizeof(_COMMAND)) / sizeof(_SHORTCUT))); + g_pscsShared->iShortcutsCount = boost::numeric_cast(std::min(cvShortcuts.size(), (SHARED_BUFFERSIZE - 5 * sizeof(_COMMAND)) / sizeof(_SHORTCUT))); _SHORTCUT* pShortcut = g_pscsShared->GetShortcutsPtr(); CShortcut sc; for (int i=0;iiShortcutsCount;i++) @@ -911,7 +911,7 @@ // kill thread that monitors clipboard CClipboardMonitor::StopMonitor(); - m_tasks.StopAllTasks(); + m_tasks.StopAllTasks(); // save m_tasks.SaveProgress(); Index: src/ch/MemDC.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/MemDC.h (.../MemDC.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/MemDC.h (.../MemDC.h) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -50,57 +50,57 @@ { public: - // constructor sets up the memory DC - CMemDC(CDC* pDC, LPCRECT lpSrcRect) : CDC() - { - ASSERT(pDC != NULL); + // constructor sets up the memory DC + CMemDC(CDC* pDC, LPCRECT lpSrcRect) : CDC() + { + ASSERT(pDC != NULL); if(!pDC) return; m_rect.CopyRect(lpSrcRect); - m_pDC = pDC; - m_pOldBitmap = NULL; - m_bMemDC = !pDC->IsPrinting(); - - if (m_bMemDC) // Create a Memory DC - { - CreateCompatibleDC(pDC); - m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); - m_pOldBitmap = SelectObject(&m_bitmap); - SetWindowOrg(m_rect.left, m_rect.top); - } - else // Make a copy of the relevent parts of the current DC for printing - { - m_bPrinting = pDC->m_bPrinting; - m_hDC = pDC->m_hDC; - m_hAttribDC = pDC->m_hAttribDC; - } - } - - // Destructor copies the contents of the mem DC to the original DC - ~CMemDC() - { - if (m_bMemDC) - { - // Copy the offscreen bitmap onto the screen. - m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), - this, m_rect.left, m_rect.top, SRCCOPY); + m_pDC = pDC; + m_pOldBitmap = NULL; + m_bMemDC = !pDC->IsPrinting(); - //Swap back the original bitmap. - SelectObject(m_pOldBitmap); - } else { - // All we need to do is replace the DC with an illegal value, - // this keeps us from accidently deleting the handles associated with - // the CDC that was passed to the constructor. - m_hDC = m_hAttribDC = NULL; - } - } + if (m_bMemDC) // Create a Memory DC + { + CreateCompatibleDC(pDC); + m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); + m_pOldBitmap = SelectObject(&m_bitmap); + SetWindowOrg(m_rect.left, m_rect.top); + } + else // Make a copy of the relevent parts of the current DC for printing + { + m_bPrinting = pDC->m_bPrinting; + m_hDC = pDC->m_hDC; + m_hAttribDC = pDC->m_hAttribDC; + } + } + // Destructor copies the contents of the mem DC to the original DC + ~CMemDC() + { + if (m_bMemDC) + { + // Copy the offscreen bitmap onto the screen. + m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), + this, m_rect.left, m_rect.top, SRCCOPY); + + //Swap back the original bitmap. + SelectObject(m_pOldBitmap); + } else { + // All we need to do is replace the DC with an illegal value, + // this keeps us from accidently deleting the handles associated with + // the CDC that was passed to the constructor. + m_hDC = m_hAttribDC = NULL; + } + } + private: - CBitmap m_bitmap; // Offscreen bitmap - CBitmap* m_pOldBitmap; // bitmap originally found in BCMenuMemDC - CDC* m_pDC; // Saves CDC passed in constructor - CRect m_rect; // Rectangle of drawing area. - BOOL m_bMemDC; // TRUE if CDC really is a Memory DC. + CBitmap m_bitmap; // Offscreen bitmap + CBitmap* m_pOldBitmap; // bitmap originally found in BCMenuMemDC + CDC* m_pDC; // Saves CDC passed in constructor + CRect m_rect; // Rectangle of drawing area. + BOOL m_bMemDC; // TRUE if CDC really is a Memory DC. }; #endif \ No newline at end of file Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -r583756058945ab95a48e17b31455b0ed4b213b8e -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision 583756058945ab95a48e17b31455b0ed4b213b8e) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -240,7 +240,7 @@ PROP_BOOL(IDS_CFG_UPDATE_CHECK_FOR_BETA, GetConfig().get_bool(PP_PUPDATE_CHECK_FOR_BETA)); PROP_BOOL(IDS_AUTOSHUTDOWN_STRING, GetConfig().get_bool(PP_PSHUTDOWNAFTREFINISHED)); PROP_UINT(IDS_SHUTDOWNTIME_STRING, GetConfig().get_signed_num(PP_PTIMEBEFORESHUTDOWN)); - PROP_COMBO(IDS_FORCESHUTDOWN_STRING, IDS_FORCESHUTDOWNVALUES_STRING, GetConfig().get_bool(PP_PFORCESHUTDOWN) ? 1 : 0); + PROP_COMBO(IDS_FORCESHUTDOWN_STRING, IDS_FORCESHUTDOWNVALUES_STRING, GetConfig().get_bool(PP_PFORCESHUTDOWN) ? 1 : 0); PROP_UINT(IDS_AUTOSAVEINTERVAL_STRING, GetConfig().get_signed_num(PP_PAUTOSAVEINTERVAL)); PROP_COMBO(IDS_CFGPRIORITYCLASS_STRING, IDS_CFGPRIORITYCLASSITEMS_STRING, PriorityClassToIndex(boost::numeric_cast(GetConfig().get_signed_num(PP_PPROCESSPRIORITYCLASS)))); PROP_DIR(IDS_TEMPFOLDER_STRING, IDS_TEMPFOLDERCHOOSE_STRING, strPath); Index: src/ch/ProgressListBox.cpp =================================================================== diff -u -rf703b71b8c856e2538283555e9fdbc84918677c3 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/ProgressListBox.cpp (.../ProgressListBox.cpp) (revision f703b71b8c856e2538283555e9fdbc84918677c3) +++ src/ch/ProgressListBox.cpp (.../ProgressListBox.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -152,7 +152,7 @@ void CProgressListBox::RecalcHeight() { // new height - int iCtlHeight = boost::numeric_cast(m_vItems.size()) * GetItemHeight(0); + int iCtlHeight = boost::numeric_cast(m_vItems.size()) * GetItemHeight(0); // change control size CRect rcCtl; @@ -172,7 +172,7 @@ _PROGRESSITEM_* CProgressListBox::GetItemAddress(int iIndex) { - if(boost::numeric_cast(m_vItems.size()) > iIndex) + if(boost::numeric_cast(m_vItems.size()) > iIndex) return m_vItems.at(iIndex); else { @@ -186,7 +186,7 @@ void CProgressListBox::UpdateItems(int nLimit, bool bUpdateSize) { // delete items from array - if(boost::numeric_cast(m_vItems.size()) > nLimit) + if(boost::numeric_cast(m_vItems.size()) > nLimit) { std::vector<_PROGRESSITEM_*>::iterator iterStart = m_vItems.begin() + nLimit; for(std::vector<_PROGRESSITEM_*>::iterator iterPos = iterStart; iterPos != m_vItems.end(); ++iterPos) @@ -196,13 +196,13 @@ m_vItems.erase(iterStart, m_vItems.end()); } // change count of elements in a listbox - if(GetCount() != boost::numeric_cast(m_vItems.size())) + if(GetCount() != boost::numeric_cast(m_vItems.size())) { - while(GetCount() < boost::numeric_cast(m_vItems.size())) + while(GetCount() < boost::numeric_cast(m_vItems.size())) AddString(_T("")); - while(GetCount() > boost::numeric_cast(m_vItems.size())) - DeleteString(boost::numeric_cast(m_vItems.size())); + while(GetCount() > boost::numeric_cast(m_vItems.size())) + DeleteString(boost::numeric_cast(m_vItems.size())); } if (bUpdateSize) Index: src/ch/PropertyListCtrl.cpp =================================================================== diff -u -r9352ed0c4fe447a36bc728640c307be6d41455fd -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision 9352ed0c4fe447a36bc728640c307be6d41455fd) +++ src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -55,13 +55,13 @@ // Create the Brushes and Pens m_pBkBrush = new CBrush( GetSysColor(COLOR_BTNFACE)); m_pBkPen = new CPen( PS_SOLID, 1, GetSysColor(COLOR_BTNFACE)); -// m_pGrayPen = new CPen( PS_SOLID, 1, RGB(128,128,128)); + // m_pGrayPen = new CPen( PS_SOLID, 1, RGB(128,128,128)); m_pBlackBrush = new CBrush(GetSysColor(COLOR_BTNTEXT)); - // Create the CButton + // Create the CButton if( !CButton::Create(_T(""), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_OWNERDRAW, Rect, pParent, uID )) return FALSE; - + return 0; } @@ -73,12 +73,12 @@ CRect ButtonRect = lpDrawItemStruct->rcItem; CMemDC dc(prDC, ButtonRect); CMemDC *pDC=&dc; - + // Fill the Background CBrush* pOldBrush = (CBrush*)pDC->SelectObject( m_pBkBrush ); CPen* pOldPen = (CPen*)pDC->SelectObject(m_pBkPen); pDC->Rectangle(ButtonRect); - + // Draw the Correct Border if(lpDrawItemStruct->itemState & ODS_SELECTED) { @@ -306,21 +306,21 @@ // Make sure its a valid item if( lpDrawItemStruct->itemID == LB_ERR ) return; - - // Obtain the text for this item + + // Obtain the text for this item m_csText.Empty(); GetText(lpDrawItemStruct->itemID, m_csText); // Get the drawing DC CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); - + // Set the Current member we are drawing - m_pCurDrawItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(lpDrawItemStruct->itemID)); - + m_pCurDrawItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(lpDrawItemStruct->itemID)); + // Obtain the Item Rect CRect ItemRect(lpDrawItemStruct->rcItem); - - // Draw This item + + // Draw This item DrawItem( pDC, ItemRect, lpDrawItemStruct->itemState & ODS_SELECTED); } void CPropertyListCtrl::MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/) @@ -551,9 +551,9 @@ QuizFileDlg.m_ofn.lpstrInitialDir = csPath; if(QuizFileDlg.DoModal() != IDOK) return; - + // Obtain the Path they selected - m_pCurItem->csProperties.SetAt(0, QuizFileDlg.GetPathName()); + m_pCurItem->csProperties.SetAt(0, QuizFileDlg.GetPathName()); // Redraw RedrawWindow(); Index: src/ch/ReplacePathsDlg.cpp =================================================================== diff -u -rf703b71b8c856e2538283555e9fdbc84918677c3 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/ReplacePathsDlg.cpp (.../ReplacePathsDlg.cpp) (revision f703b71b8c856e2538283555e9fdbc84918677c3) +++ src/ch/ReplacePathsDlg.cpp (.../ReplacePathsDlg.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -83,10 +83,10 @@ InitializeResizableControls(); for(size_t stIndex = 0; stIndex < m_spTask->GetClipboardDataSize(); ++stIndex) - { - m_ctlPathsList.AddString(m_spTask->GetClipboardData(stIndex)->GetPath()); - } - + { + m_ctlPathsList.AddString(m_spTask->GetClipboardData(stIndex)->GetPath()); + } + return TRUE; } Index: src/ch/StaticEx.cpp =================================================================== diff -u -r9352ed0c4fe447a36bc728640c307be6d41455fd -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision 9352ed0c4fe447a36bc728640c307be6d41455fd) +++ src/ch/StaticEx.cpp (.../StaticEx.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -328,25 +328,25 @@ bool RegisterStaticExControl(HINSTANCE hInstance) { - WNDCLASS wndcls; + WNDCLASS wndcls; - if (!(::GetClassInfo(hInstance, STATICEX_CLASS, &wndcls))) - { - // need to register a new class - wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; + if (!(::GetClassInfo(hInstance, STATICEX_CLASS, &wndcls))) + { + // need to register a new class + wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; wndcls.lpfnWndProc = ::StaticExWndProc; - wndcls.cbClsExtra = 0; + wndcls.cbClsExtra = 0; wndcls.cbWndExtra = sizeof(STATICEXSETTINGS*); - wndcls.hInstance = hInstance; - wndcls.hIcon = NULL; + wndcls.hInstance = hInstance; + wndcls.hIcon = NULL; wndcls.hCursor = NULL; // will load each time needed - wndcls.hbrBackground = NULL; - wndcls.lpszMenuName = NULL; - wndcls.lpszClassName = STATICEX_CLASS; + wndcls.hbrBackground = NULL; + wndcls.lpszMenuName = NULL; + wndcls.lpszClassName = STATICEX_CLASS; - if (!RegisterClass(&wndcls)) - return false; - } + if (!RegisterClass(&wndcls)) + return false; + } - return true; + return true; } Index: src/ch/StatusDlg.cpp =================================================================== diff -u -r1fa2eb7e39e2f8d84868d421fe1c4f0afc58d353 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 1fa2eb7e39e2f8d84868d421fe1c4f0afc58d353) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -113,26 +113,26 @@ lvc.fmt=LVCFMT_LEFT; lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.27*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=-1; m_ctlStatusList.InsertColumn(1, &lvc); lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.3*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3*iWidth); lvc.iSubItem=0; m_ctlStatusList.InsertColumn(2, &lvc); lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.27*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=1; m_ctlStatusList.InsertColumn(3, &lvc); lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15*iWidth); lvc.iSubItem=2; m_ctlStatusList.InsertColumn(4, &lvc); @@ -165,7 +165,7 @@ { if(m_pTasks->GetAt(stIndex) == m_spInitialSelection) { - m_ctlStatusList.SetItemState(boost::numeric_cast(stIndex), LVIS_SELECTED, LVIS_SELECTED); + m_ctlStatusList.SetItemState(boost::numeric_cast(stIndex), LVIS_SELECTED, LVIS_SELECTED); break; } @@ -220,9 +220,9 @@ void CStatusDlg::AddTaskInfo(int nPos, const CTaskPtr& spTask, DWORD dwCurrentTime) { - _ASSERTE(spTask != NULL); - if(spTask == NULL) - return; + _ASSERTE(spTask != NULL); + if(spTask == NULL) + return; // index to string _itot(nPos, m_szData, 10); @@ -339,7 +339,7 @@ dlg.m_bsSizes = *spTask->GetBufferSizes(); dlg.m_iActiveIndex = spTask->GetCurrentBufferIndex(); if(dlg.DoModal() == IDOK) - spTask->SetBufferSizes(&dlg.m_bsSizes); + spTask->SetBufferSizes(&dlg.m_bsSizes); } CTaskPtr CStatusDlg::GetSelectedItemPointer() @@ -525,69 +525,69 @@ { CTaskPtr spTask = GetSelectedItemPointer(); if(spTask) - { - TRACE("PauseProcessing call...\n"); - spTask->PauseProcessing(); + { + TRACE("PauseProcessing call...\n"); + spTask->PauseProcessing(); - RefreshStatus(); - } + RefreshStatus(); + } } void CStatusDlg::OnResumeButton() { - CTaskPtr spTask = GetSelectedItemPointer(); + CTaskPtr spTask = GetSelectedItemPointer(); if(spTask) - { - if(spTask->GetStatus(ST_WAITING_MASK) & ST_WAITING) - spTask->SetForceFlag(); - else - spTask->ResumeProcessing(); + { + if(spTask->GetStatus(ST_WAITING_MASK) & ST_WAITING) + spTask->SetForceFlag(); + else + spTask->ResumeProcessing(); - RefreshStatus(); - } + RefreshStatus(); + } } void CStatusDlg::OnCancelButton() { - CTaskPtr spTask = GetSelectedItemPointer(); + CTaskPtr spTask = GetSelectedItemPointer(); if(spTask) - { - spTask->CancelProcessing(); - RefreshStatus(); - } + { + spTask->CancelProcessing(); + RefreshStatus(); + } } void CStatusDlg::OnRestartButton() { - CTaskPtr spTask = GetSelectedItemPointer(); + CTaskPtr spTask = GetSelectedItemPointer(); if(spTask) - { - spTask->RestartProcessing(); - RefreshStatus(); - } + { + spTask->RestartProcessing(); + RefreshStatus(); + } } void CStatusDlg::OnDeleteButton() { - CTaskPtr spTask = GetSelectedItemPointer(); + CTaskPtr spTask = GetSelectedItemPointer(); if(spTask) - { - UINT uiStatus = spTask->GetStatus(ST_STEP_MASK); - if((uiStatus & ST_STEP_MASK) != ST_FINISHED && (uiStatus & ST_STEP_MASK) != ST_CANCELLED) - { - // ask if cancel - if(MsgBox(IDS_CONFIRMCANCEL_STRING, MB_OKCANCEL | MB_ICONQUESTION) == IDOK) - { - // cancel - spTask->CancelProcessing(); - } - else - return; - } + { + UINT uiStatus = spTask->GetStatus(ST_STEP_MASK); + if((uiStatus & ST_STEP_MASK) != ST_FINISHED && (uiStatus & ST_STEP_MASK) != ST_CANCELLED) + { + // ask if cancel + if(MsgBox(IDS_CONFIRMCANCEL_STRING, MB_OKCANCEL | MB_ICONQUESTION) == IDOK) + { + // cancel + spTask->CancelProcessing(); + } + else + return; + } - m_pTasks->RemoveFinished(spTask); - RefreshStatus(); - } + m_pTasks->RemoveFinished(spTask); + RefreshStatus(); + } } void CStatusDlg::OnPauseAllButton() @@ -634,7 +634,7 @@ break; case VK_SPACE: { - CTaskPtr spTask = GetSelectedItemPointer(); + CTaskPtr spTask = GetSelectedItemPointer(); if (!spTask) return; @@ -699,13 +699,13 @@ // add task info for(size_t stIndex = 0; stIndex < m_pTasks->GetSize(); ++stIndex) - { - AddTaskInfo(boost::numeric_cast(stIndex), m_pTasks->GetAt(stIndex), dwCurrentTime); - } - + { + AddTaskInfo(boost::numeric_cast(stIndex), m_pTasks->GetAt(stIndex), dwCurrentTime); + } + // percent int nPercent=m_pTasks->GetPercent(); - + // set title if (m_pTasks->GetSize() != 0) _sntprintf(m_szData, _MAX_PATH, _T("%s [%d %%]"), GetResManager().LoadString(IDS_STATUSTITLE_STRING), m_pTasks->GetPercent()); @@ -916,26 +916,26 @@ lvc.fmt=LVCFMT_LEFT; lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.27*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=-1; m_ctlStatusList.InsertColumn(1, &lvc); lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.3*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3*iWidth); lvc.iSubItem=0; m_ctlStatusList.InsertColumn(2, &lvc); lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.27*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); lvc.iSubItem=1; m_ctlStatusList.InsertColumn(3, &lvc); lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ - lvc.cchTextMax = lstrlen(lvc.pszText); - lvc.cx = static_cast(0.15*iWidth); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15*iWidth); lvc.iSubItem=2; m_ctlStatusList.InsertColumn(4, &lvc); Index: src/ch/Theme Helpers.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/Theme Helpers.h (.../Theme Helpers.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/Theme Helpers.h (.../Theme Helpers.h) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -48,122 +48,6 @@ HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect); HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc); -/* HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect); - -THEMEAPI GetThemeBackgroundContentRect(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, const RECT *pBoundingRect, - OUT RECT *pContentRect); - -THEMEAPI GetThemeBackgroundExtent(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, const RECT *pContentRect, - OUT RECT *pExtentRect); - -THEMEAPI GetThemeTextMetrics(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, OUT TEXTMETRIC* ptm); - -THEMEAPI GetThemeBackgroundRegion(HTHEME hTheme, OPTIONAL HDC hdc, - int iPartId, int iStateId, const RECT *pRect, OUT HRGN *pRegion); - -THEMEAPI HitTestThemeBackground(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, DWORD dwOptions, const RECT *pRect, OPTIONAL HRGN hrgn, - POINT ptTest, OUT WORD *pwHitTestCode); - -THEMEAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, - const RECT *pDestRect, UINT uEdge, UINT uFlags, OPTIONAL OUT RECT *pContentRect); - -THEMEAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, - int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); - -THEMEAPI_(BOOL) IsThemePartDefined(HTHEME hTheme, int iPartId, - int iStateId); - -THEMEAPI_(BOOL) IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, - int iPartId, int iStateId); - -THEMEAPI GetThemeColor(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT COLORREF *pColor); - -THEMEAPI GetThemeMetric(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, int iPropId, OUT int *piVal); - -THEMEAPI GetThemeString(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars); - -THEMEAPI GetThemeBool(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT BOOL *pfVal); - -THEMEAPI GetThemeInt(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT int *piVal); - -THEMEAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT int *piVal); - -THEMEAPI GetThemePosition(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT POINT *pPoint); - -THEMEAPI GetThemeFont(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, int iPropId, OUT LOGFONT *pFont); - -THEMEAPI GetThemeRect(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT RECT *pRect); - -THEMEAPI GetThemeMargins(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, - int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins); - -THEMEAPI GetThemeIntList(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT INTLIST *pIntList); - -THEMEAPI GetThemePropertyOrigin(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin); - -THEMEAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, - LPCWSTR pszSubIdList); - -THEMEAPI GetThemeFilename(HTHEME hTheme, int iPartId, - int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars); - -THEMEAPI_(COLORREF) GetThemeSysColor(HTHEME hTheme, int iColorId); - -THEMEAPI_(HBRUSH) GetThemeSysColorBrush(HTHEME hTheme, int iColorId); - -THEMEAPI_(BOOL) GetThemeSysBool(HTHEME hTheme, int iBoolId); - -THEMEAPI_(int) GetThemeSysSize(HTHEME hTheme, int iSizeId); - -THEMEAPI GetThemeSysFont(HTHEME hTheme, int iFontId, OUT LOGFONT *plf); - -THEMEAPI GetThemeSysString(HTHEME hTheme, int iStringId, - OUT LPWSTR pszStringBuff, int cchMaxStringChars); - -THEMEAPI GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue); - -THEMEAPI_(BOOL) IsThemeActive(); - - -THEMEAPI_(HTHEME) GetWindowTheme(HWND hwnd); - - -THEMEAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); - - -THEMEAPI_(BOOL) IsThemeDialogTextureEnabled(HWND hwnd); - -THEMEAPI_(DWORD) GetThemeAppProperties(); - -THEMEAPI_(void) SetThemeAppProperties(DWORD dwFlags); - -THEMEAPI GetCurrentThemeName( - OUT LPWSTR pszThemeFileName, int cchMaxNameChars, - OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, - OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars); - -THEMEAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName, - LPCWSTR pszPropertyName, OUT LPWSTR pszValueBuff, int cchMaxValChars); - -THEMEAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, OPTIONAL RECT* prc); - -THEMEAPI EnableTheming(BOOL fEnable); -*/ protected: HMODULE m_hThemesDll; Index: src/ch/TrayIcon.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/TrayIcon.cpp (.../TrayIcon.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/TrayIcon.cpp (.../TrayIcon.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -78,7 +78,7 @@ void CTrayIcon::RemoveIcon() { m_tnd.uFlags=0; - Shell_NotifyIcon(NIM_DELETE, &m_tnd); + Shell_NotifyIcon(NIM_DELETE, &m_tnd); } void CTrayIcon::HideIcon() Index: src/ch/task.cpp =================================================================== diff -u -r1fa2eb7e39e2f8d84868d421fe1c4f0afc58d353 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/task.cpp (.../task.cpp) (revision 1fa2eb7e39e2f8d84868d421fe1c4f0afc58d353) +++ src/ch/task.cpp (.../task.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -65,9 +65,9 @@ // TTasksGlobalStats members TTasksGlobalStats::TTasksGlobalStats() : - m_ullGlobalTotalSize(0), - m_ullGlobalProcessedSize(0), - m_stRunningTasks(0) +m_ullGlobalTotalSize(0), +m_ullGlobalProcessedSize(0), +m_stRunningTasks(0) { } @@ -77,258 +77,258 @@ void TTasksGlobalStats::IncreaseGlobalTotalSize(unsigned long long ullModify) { - m_lock.lock(); - m_ullGlobalTotalSize += ullModify; - m_lock.unlock(); + m_lock.lock(); + m_ullGlobalTotalSize += ullModify; + m_lock.unlock(); } void TTasksGlobalStats::DecreaseGlobalTotalSize(unsigned long long ullModify) { - m_lock.lock(); - m_ullGlobalTotalSize -= ullModify; - m_lock.unlock(); + m_lock.lock(); + m_ullGlobalTotalSize -= ullModify; + m_lock.unlock(); } unsigned long long TTasksGlobalStats::GetGlobalTotalSize() const { - boost::shared_lock lock(m_lock); - return m_ullGlobalTotalSize; + boost::shared_lock lock(m_lock); + return m_ullGlobalTotalSize; } void TTasksGlobalStats::IncreaseGlobalProcessedSize(unsigned long long ullModify) { - m_lock.lock(); - m_ullGlobalProcessedSize += ullModify; - m_lock.unlock(); + m_lock.lock(); + m_ullGlobalProcessedSize += ullModify; + m_lock.unlock(); } void TTasksGlobalStats::DecreaseGlobalProcessedSize(unsigned long long ullModify) { - m_lock.lock(); - m_ullGlobalProcessedSize -= ullModify; - m_lock.unlock(); + m_lock.lock(); + m_ullGlobalProcessedSize -= ullModify; + m_lock.unlock(); } unsigned long long TTasksGlobalStats::GetGlobalProcessedSize() const { - boost::shared_lock lock(m_lock); - return m_ullGlobalProcessedSize; + boost::shared_lock lock(m_lock); + return m_ullGlobalProcessedSize; } void TTasksGlobalStats::IncreaseGlobalProgressData(unsigned long long ullTasksPosition, unsigned long long ullTasksSize) { - m_lock.lock(); - m_ullGlobalTotalSize += ullTasksSize; - m_ullGlobalProcessedSize += ullTasksPosition; - m_lock.unlock(); + m_lock.lock(); + m_ullGlobalTotalSize += ullTasksSize; + m_ullGlobalProcessedSize += ullTasksPosition; + m_lock.unlock(); } void TTasksGlobalStats::DecreaseGlobalProgressData(unsigned long long ullTasksPosition, unsigned long long ullTasksSize) { - m_lock.lock(); - m_ullGlobalTotalSize -= ullTasksSize; - m_ullGlobalProcessedSize -= ullTasksPosition; - m_lock.unlock(); + m_lock.lock(); + m_ullGlobalTotalSize -= ullTasksSize; + m_ullGlobalProcessedSize -= ullTasksPosition; + m_lock.unlock(); } int TTasksGlobalStats::GetProgressPercents() const { - unsigned long long llPercent = 0; + unsigned long long llPercent = 0; - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); - if(m_ullGlobalTotalSize != 0) - llPercent = m_ullGlobalProcessedSize * 100 / m_ullGlobalTotalSize; + if(m_ullGlobalTotalSize != 0) + llPercent = m_ullGlobalProcessedSize * 100 / m_ullGlobalTotalSize; - return boost::numeric_cast(llPercent); + return boost::numeric_cast(llPercent); } void TTasksGlobalStats::IncreaseRunningTasks() { - m_lock.lock(); - ++m_stRunningTasks; - m_lock.unlock(); + m_lock.lock(); + ++m_stRunningTasks; + m_lock.unlock(); } void TTasksGlobalStats::DecreaseRunningTasks() { - m_lock.lock(); - --m_stRunningTasks; - m_lock.unlock(); + m_lock.lock(); + --m_stRunningTasks; + m_lock.unlock(); } size_t TTasksGlobalStats::GetRunningTasksCount() const { - boost::shared_lock lock(m_lock); - return m_stRunningTasks; + boost::shared_lock lock(m_lock); + return m_stRunningTasks; } //////////////////////////////////////////////////////////////////////////////// // TTasksGlobalStats members TTaskLocalStats::TTaskLocalStats() : - m_prtGlobalStats(NULL), - m_ullProcessedSize(0), - m_ullTotalSize(0), - m_bTaskIsRunning(false), - m_timeElapsed(0), - m_timeLast(-1) + m_prtGlobalStats(NULL), + m_ullProcessedSize(0), + m_ullTotalSize(0), + m_bTaskIsRunning(false), + m_timeElapsed(0), + m_timeLast(-1) { } TTaskLocalStats::~TTaskLocalStats() { - DisconnectGlobalStats(); + DisconnectGlobalStats(); } void TTaskLocalStats::ConnectGlobalStats(TTasksGlobalStats& rtGlobalStats) { - DisconnectGlobalStats(); + DisconnectGlobalStats(); - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); - m_prtGlobalStats = &rtGlobalStats; - m_prtGlobalStats->IncreaseGlobalProgressData(m_ullProcessedSize, m_ullTotalSize); - if(m_bTaskIsRunning) - m_prtGlobalStats->IncreaseRunningTasks(); + m_prtGlobalStats = &rtGlobalStats; + m_prtGlobalStats->IncreaseGlobalProgressData(m_ullProcessedSize, m_ullTotalSize); + if(m_bTaskIsRunning) + m_prtGlobalStats->IncreaseRunningTasks(); } void TTaskLocalStats::DisconnectGlobalStats() { - boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - { - m_prtGlobalStats->DecreaseGlobalProgressData(m_ullProcessedSize, m_ullTotalSize); - m_prtGlobalStats = NULL; - if(m_bTaskIsRunning) - m_prtGlobalStats->DecreaseRunningTasks(); - } + boost::unique_lock lock(m_lock); + if(m_prtGlobalStats) + { + m_prtGlobalStats->DecreaseGlobalProgressData(m_ullProcessedSize, m_ullTotalSize); + m_prtGlobalStats = NULL; + if(m_bTaskIsRunning) + m_prtGlobalStats->DecreaseRunningTasks(); + } } void TTaskLocalStats::IncreaseProcessedSize(unsigned long long ullAdd) { - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - m_prtGlobalStats->IncreaseGlobalProcessedSize(ullAdd); + if(m_prtGlobalStats) + m_prtGlobalStats->IncreaseGlobalProcessedSize(ullAdd); - m_ullProcessedSize += ullAdd; + m_ullProcessedSize += ullAdd; } void TTaskLocalStats::DecreaseProcessedSize(unsigned long long ullSub) { - boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - m_prtGlobalStats->DecreaseGlobalProcessedSize(ullSub); + boost::unique_lock lock(m_lock); + if(m_prtGlobalStats) + m_prtGlobalStats->DecreaseGlobalProcessedSize(ullSub); - m_ullProcessedSize -= ullSub; + m_ullProcessedSize -= ullSub; } void TTaskLocalStats::SetProcessedSize(unsigned long long ullSet) { - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - { - if(ullSet < m_ullProcessedSize) - m_prtGlobalStats->DecreaseGlobalProcessedSize(m_ullProcessedSize - ullSet); - else - m_prtGlobalStats->IncreaseGlobalProcessedSize(ullSet - m_ullProcessedSize); - } + if(m_prtGlobalStats) + { + if(ullSet < m_ullProcessedSize) + m_prtGlobalStats->DecreaseGlobalProcessedSize(m_ullProcessedSize - ullSet); + else + m_prtGlobalStats->IncreaseGlobalProcessedSize(ullSet - m_ullProcessedSize); + } - m_ullProcessedSize = ullSet; + m_ullProcessedSize = ullSet; } unsigned long long TTaskLocalStats::GetProcessedSize() const { - boost::shared_lock lock(m_lock); - return m_ullProcessedSize; + boost::shared_lock lock(m_lock); + return m_ullProcessedSize; } unsigned long long TTaskLocalStats::GetUnProcessedSize() const { - boost::shared_lock lock(m_lock); - return m_ullTotalSize - m_ullProcessedSize; + boost::shared_lock lock(m_lock); + return m_ullTotalSize - m_ullProcessedSize; } void TTaskLocalStats::IncreaseTotalSize(unsigned long long ullAdd) { - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - m_prtGlobalStats->IncreaseGlobalTotalSize(ullAdd); - m_ullTotalSize += ullAdd; + if(m_prtGlobalStats) + m_prtGlobalStats->IncreaseGlobalTotalSize(ullAdd); + m_ullTotalSize += ullAdd; } void TTaskLocalStats::DecreaseTotalSize(unsigned long long ullSub) { - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - m_prtGlobalStats->DecreaseGlobalTotalSize(ullSub); + if(m_prtGlobalStats) + m_prtGlobalStats->DecreaseGlobalTotalSize(ullSub); - m_ullTotalSize -= ullSub; + m_ullTotalSize -= ullSub; } void TTaskLocalStats::SetTotalSize(unsigned long long ullSet) { - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); - if(m_prtGlobalStats) - { - if(ullSet < m_ullTotalSize) - m_prtGlobalStats->DecreaseGlobalTotalSize(m_ullTotalSize - ullSet); - else - m_prtGlobalStats->IncreaseGlobalTotalSize(ullSet - m_ullTotalSize); - } + if(m_prtGlobalStats) + { + if(ullSet < m_ullTotalSize) + m_prtGlobalStats->DecreaseGlobalTotalSize(m_ullTotalSize - ullSet); + else + m_prtGlobalStats->IncreaseGlobalTotalSize(ullSet - m_ullTotalSize); + } - m_ullTotalSize = ullSet; + m_ullTotalSize = ullSet; } unsigned long long TTaskLocalStats::GetTotalSize() const { - boost::shared_lock lock(m_lock); - return m_ullTotalSize; + boost::shared_lock lock(m_lock); + return m_ullTotalSize; } int TTaskLocalStats::GetProgressInPercent() const { - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); - unsigned long long ullPercent = 0; + unsigned long long ullPercent = 0; - if(m_ullTotalSize != 0) - ullPercent = m_ullProcessedSize * 100 / m_ullTotalSize; + if(m_ullTotalSize != 0) + ullPercent = m_ullProcessedSize * 100 / m_ullTotalSize; - return boost::numeric_cast(ullPercent); + return boost::numeric_cast(ullPercent); } void TTaskLocalStats::MarkTaskAsRunning() { - boost::unique_lock lock(m_lock); - if(!m_bTaskIsRunning) - { - if(m_prtGlobalStats) - m_prtGlobalStats->IncreaseRunningTasks(); - m_bTaskIsRunning = true; - } + boost::unique_lock lock(m_lock); + if(!m_bTaskIsRunning) + { + if(m_prtGlobalStats) + m_prtGlobalStats->IncreaseRunningTasks(); + m_bTaskIsRunning = true; + } } void TTaskLocalStats::MarkTaskAsNotRunning() { - boost::unique_lock lock(m_lock); - if(m_bTaskIsRunning) - { - if(m_prtGlobalStats) - m_prtGlobalStats->DecreaseRunningTasks(); - m_bTaskIsRunning = false; - } + boost::unique_lock lock(m_lock); + if(m_bTaskIsRunning) + { + if(m_prtGlobalStats) + m_prtGlobalStats->DecreaseRunningTasks(); + m_bTaskIsRunning = false; + } } bool TTaskLocalStats::IsRunning() const { - boost::shared_lock lock(m_lock); - return m_bTaskIsRunning; + boost::shared_lock lock(m_lock); + return m_bTaskIsRunning; } void TTaskLocalStats::SetTimeElapsed(time_t timeElapsed) @@ -408,42 +408,42 @@ _itot((int)time(NULL), m_strUniqueName.GetBufferSetLength(16), 10); m_strUniqueName.ReleaseBuffer(); -} + } -CTask::~CTask() -{ - KillThread(); - if(m_piFeedbackHandler) - m_piFeedbackHandler->Delete(); -} + CTask::~CTask() + { + KillThread(); + if(m_piFeedbackHandler) + m_piFeedbackHandler->Delete(); + } -void CTask::OnRegisterTask(TTasksGlobalStats& rtGlobalStats) -{ - m_localStats.ConnectGlobalStats(rtGlobalStats); -} + void CTask::OnRegisterTask(TTasksGlobalStats& rtGlobalStats) + { + m_localStats.ConnectGlobalStats(rtGlobalStats); + } -void CTask::OnUnregisterTask() -{ - m_localStats.DisconnectGlobalStats(); -} + void CTask::OnUnregisterTask() + { + m_localStats.DisconnectGlobalStats(); + } -// m_clipboard -void CTask::AddClipboardData(const CClipboardEntryPtr& spEntry) -{ - m_clipboard.Add(spEntry); -} + // m_clipboard + void CTask::AddClipboardData(const CClipboardEntryPtr& spEntry) + { + m_clipboard.Add(spEntry); + } -CClipboardEntryPtr CTask::GetClipboardData(size_t stIndex) -{ - return m_clipboard.GetAt(stIndex); -} + CClipboardEntryPtr CTask::GetClipboardData(size_t stIndex) + { + return m_clipboard.GetAt(stIndex); + } -size_t CTask::GetClipboardDataSize() -{ - return m_clipboard.GetSize(); -} + size_t CTask::GetClipboardDataSize() + { + return m_clipboard.GetSize(); + } -int CTask::ReplaceClipboardStrings(CString strOld, CString strNew) + int CTask::ReplaceClipboardStrings(CString strOld, CString strNew) { return m_clipboard.ReplacePathsPrefix(strOld, strNew); } @@ -621,9 +621,9 @@ // m_nPriority int CTask::GetPriority() { - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); - return m_nPriority; + return m_nPriority; } void CTask::SetPriority(int nPriority) @@ -645,15 +645,15 @@ ullTotalSize *= m_ucCopies; - m_localStats.SetTotalSize(ullTotalSize); + m_localStats.SetTotalSize(ullTotalSize); } void CTask::CalculateProcessedSize() { unsigned long long ullProcessedSize = 0; // count all from previous passes - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); if(m_ucCopies) ullProcessedSize += m_ucCurrentCopy * (m_localStats.GetTotalSize() / m_ucCopies); else @@ -671,7 +671,7 @@ CString CTask::GetUniqueName() { - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); return m_strUniqueName; } @@ -680,7 +680,7 @@ std::ifstream ifs(strPath, ios_base::in | ios_base::binary); boost::archive::binary_iarchive ar(ifs); - boost::unique_lock lock(m_lock); + boost::unique_lock lock(m_lock); if(bData) { m_clipboard.Load(ar, 0, bData); @@ -731,12 +731,12 @@ void CTask::Store(bool bData) { - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); BOOST_ASSERT(!m_strTaskBasePath.empty()); if(m_strTaskBasePath.empty()) THROW(_t("Missing task path."), 0, 0, 0); - if(!bData && m_bSaved) + if(!bData && m_bSaved) return; if(!bData && !m_bSaved && ( (m_nStatus & ST_STEP_MASK) == ST_FINISHED || (m_nStatus & ST_STEP_MASK) == ST_CANCELLED @@ -883,7 +883,7 @@ void CTask::GetMiniSnapshot(TASK_MINI_DISPLAY_DATA *pData) { - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); if(m_stCurrentIndex >= 0 && m_stCurrentIndex < m_files.GetSize()) pData->m_strPath = m_files.GetAt(m_stCurrentIndex)->GetFileName(); else @@ -893,7 +893,7 @@ else { if(m_clipboard.GetSize() > 0) - pData->m_strPath = m_clipboard.GetAt(0)->GetFileName(); + pData->m_strPath = m_clipboard.GetAt(0)->GetFileName(); else pData->m_strPath = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); } @@ -902,7 +902,7 @@ pData->m_uiStatus=m_nStatus; // percents - pData->m_nPercent = m_localStats.GetProgressInPercent(); + pData->m_nPercent = m_localStats.GetProgressInPercent(); } void CTask::GetSnapshot(TASK_DISPLAY_DATA *pData) @@ -1249,17 +1249,17 @@ void CTask::CalculateTotalSizeNL() { - unsigned long long ullTotalSize = 0; + unsigned long long ullTotalSize = 0; - size_t nSize = m_files.GetSize(); - for(size_t i = 0; i < nSize; i++) - { - ullTotalSize += m_files.GetAt(i)->GetLength64(); - } + size_t nSize = m_files.GetSize(); + for(size_t i = 0; i < nSize; i++) + { + ullTotalSize += m_files.GetAt(i)->GetLength64(); + } - ullTotalSize *= m_ucCopies; + ullTotalSize *= m_ucCopies; - m_localStats.SetTotalSize(ullTotalSize); + m_localStats.SetTotalSize(ullTotalSize); } CString CTask::GetUniqueNameNL() @@ -2796,32 +2796,32 @@ void CTask::OnBeginOperation() { - CTime tm=CTime::GetCurrentTime(); + CTime tm=CTime::GetCurrentTime(); - ictranslate::CFormat fmt; - fmt.SetFormat(_T("\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second")); - fmt.SetParam(_t("%year"), tm.GetYear()); - fmt.SetParam(_t("%month"), tm.GetMonth()); - fmt.SetParam(_t("%day"), tm.GetDay()); - fmt.SetParam(_t("%hour"), tm.GetHour()); - fmt.SetParam(_t("%minute"), tm.GetMinute()); - fmt.SetParam(_t("%second"), tm.GetSecond()); - m_log.logi(fmt); + ictranslate::CFormat fmt; + fmt.SetFormat(_T("\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second")); + fmt.SetParam(_t("%year"), tm.GetYear()); + fmt.SetParam(_t("%month"), tm.GetMonth()); + fmt.SetParam(_t("%day"), tm.GetDay()); + fmt.SetParam(_t("%hour"), tm.GetHour()); + fmt.SetParam(_t("%minute"), tm.GetMinute()); + fmt.SetParam(_t("%second"), tm.GetSecond()); + m_log.logi(fmt); } void CTask::OnEndOperation() { - CTime tm=CTime::GetCurrentTime(); + CTime tm=CTime::GetCurrentTime(); - ictranslate::CFormat fmt; - fmt.SetFormat(_T("Finished processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second")); - fmt.SetParam(_t("%year"), tm.GetYear()); - fmt.SetParam(_t("%month"), tm.GetMonth()); - fmt.SetParam(_t("%day"), tm.GetDay()); - fmt.SetParam(_t("%hour"), tm.GetHour()); - fmt.SetParam(_t("%minute"), tm.GetMinute()); - fmt.SetParam(_t("%second"), tm.GetSecond()); - m_log.logi(fmt); + ictranslate::CFormat fmt; + fmt.SetFormat(_T("Finished processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second")); + fmt.SetParam(_t("%year"), tm.GetYear()); + fmt.SetParam(_t("%month"), tm.GetMonth()); + fmt.SetParam(_t("%day"), tm.GetDay()); + fmt.SetParam(_t("%hour"), tm.GetHour()); + fmt.SetParam(_t("%minute"), tm.GetMinute()); + fmt.SetParam(_t("%second"), tm.GetSecond()); + m_log.logi(fmt); } void CTask::RequestStopThread() @@ -2917,8 +2917,8 @@ m_vTasks.push_back(spNewTask); - spNewTask->OnRegisterTask(m_globalStats); - + spNewTask->OnRegisterTask(m_globalStats); + return m_vTasks.size() - 1; } @@ -2936,8 +2936,8 @@ // kill task if needed spTask->KillThread(); - - spTask->OnUnregisterTask(); + + spTask->OnUnregisterTask(); } // remove elements from array @@ -2997,8 +2997,8 @@ // kill task if needed spTask->KillThread(); - spTask->OnUnregisterTask(); - + spTask->OnUnregisterTask(); + // delete associated files spTask->DeleteProgress(m_strTasksDir.c_str()); @@ -3181,16 +3181,16 @@ bFlag = false; else { - boost::shared_lock lock(m_lock); + boost::shared_lock lock(m_lock); BOOST_FOREACH(CTaskPtr& spTask, m_vTasks) { uiStatus = spTask->GetStatus(); bFlag = ((uiStatus & ST_STEP_MASK) == ST_FINISHED || (uiStatus & ST_STEP_MASK) == ST_CANCELLED - || (uiStatus & ST_WORKING_MASK) == ST_PAUSED - || ((uiStatus & ST_WORKING_MASK) == ST_ERROR && !GetConfig().get_bool(PP_CMAUTORETRYONERROR))); + || (uiStatus & ST_WORKING_MASK) == ST_PAUSED + || ((uiStatus & ST_WORKING_MASK) == ST_ERROR && !GetConfig().get_bool(PP_CMAUTORETRYONERROR))); - if(!bFlag) - break; + if(!bFlag) + break; } } Index: src/ch/task.h =================================================================== diff -u -r1fa2eb7e39e2f8d84868d421fe1c4f0afc58d353 -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/ch/task.h (.../task.h) (revision 1fa2eb7e39e2f8d84868d421fe1c4f0afc58d353) +++ src/ch/task.h (.../task.h) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -76,8 +76,8 @@ // structure for getting status of a task struct TASK_DISPLAY_DATA { - CString m_strFullFilePath; - CString m_strFileName; + CString m_strFullFilePath; + CString m_strFileName; //CFileInfoPtr m_spFileInfo; // fi at CurrIndex int m_iCurrentBufferIndex; size_t m_stIndex; @@ -107,8 +107,7 @@ struct TASK_MINI_DISPLAY_DATA { - CString m_strPath; -// CFileInfoPtr m_spFileInfo; // fi at CurrIndex + CString m_strPath; UINT m_uiStatus; int m_nPercent; @@ -135,7 +134,7 @@ /// @brief Constructs the TAutoFileHandle object. // ============================================================================ TAutoFileHandle() : - m_hHandle(INVALID_HANDLE_VALUE) + m_hHandle(INVALID_HANDLE_VALUE) { } Index: src/chext/DropMenuExt.cpp =================================================================== diff -u -r9352ed0c4fe447a36bc728640c307be6d41455fd -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision 9352ed0c4fe447a36bc728640c307be6d41455fd) +++ src/chext/DropMenuExt.cpp (.../DropMenuExt.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -276,7 +276,7 @@ STDMETHODIMP CDropMenuExt::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* /*plResult*/) { - uMsg; wParam; lParam; + uMsg; wParam; lParam; ATLTRACE(_T("CDropMenuExt::HandleMenuMsg2(): uMsg = %lu, wParam = %lu, lParam = %lu\n"), uMsg, wParam, lParam); return S_FALSE; } Index: src/chext/chext.cpp =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -rc435ab507c8b8280264188b49e9ada56d46c0261 --- src/chext/chext.cpp (.../chext.cpp) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/chext/chext.cpp (.../chext.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) @@ -31,32 +31,32 @@ STDAPI DllCanUnloadNow(void) { - return _AtlModule.DllCanUnloadNow(); + return _AtlModule.DllCanUnloadNow(); } ///////////////////////////////////////////////////////////////////////////// // Returns a class factory to create an object of the requested type STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { - return _AtlModule.DllGetClassObject(rclsid, riid, ppv); + return _AtlModule.DllGetClassObject(rclsid, riid, ppv); } ///////////////////////////////////////////////////////////////////////////// // DllRegisterServer - Adds entries to the system registry STDAPI DllRegisterServer() { - // registers object, typelib and all interfaces in typelib - return _AtlModule.DllRegisterServer(); + // registers object, typelib and all interfaces in typelib + return _AtlModule.DllRegisterServer(); } ///////////////////////////////////////////////////////////////////////////// // DllUnregisterServer - Removes entries from the system registry STDAPI DllUnregisterServer(void) { - return _AtlModule.DllUnregisterServer(); + return _AtlModule.DllUnregisterServer(); } // DllInstall - Adds/Removes entries to the system registry per user