• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revisão29184 (tree)
Hora2021-05-02 22:14:32
Autorstefankueng

Mensagem de Log

cleanup utility dialogs

Mudança Sumário

Diff

--- trunk/src/SVN/SVNRev.h (revision 29183)
+++ trunk/src/SVN/SVNRev.h (revision 29184)
@@ -52,8 +52,9 @@
5252 rev.kind = svn_opt_revision_unspecified;
5353 m_bIsValid = FALSE;
5454 }
55- ~SVNRev();
5655
56+ virtual ~SVNRev();
57+
5758 /// returns TRUE if the revision is valid (i.e. not unspecified)
5859 BOOL IsValid() const { return m_bIsValid; }
5960 /// returns TRUE if the revision is HEAD
--- trunk/src/TortoiseProc/Commands/SyncCommand.cpp (revision 29183)
+++ trunk/src/TortoiseProc/Commands/SyncCommand.cpp (revision 29184)
@@ -170,7 +170,7 @@
170170 CPasswordDlg passDlg(CWnd::FromHandle(GetExplorerHWND()));
171171 passDlg.m_bForSave = !!parser.HasKey(L"save");
172172 dlgRet = passDlg.DoModal();
173- password = passDlg.m_sPW1;
173+ password = passDlg.m_sPw1;
174174 if ((dlgRet == IDOK) && (parser.HasKey(L"load")))
175175 {
176176 std::string passworda = CUnicodeUtils::StdGetUTF8(static_cast<LPCWSTR>(password));
@@ -608,7 +608,7 @@
608608 passDlg.m_bForSave = true;
609609 if (passDlg.DoModal() != IDOK)
610610 return false;
611- password = passDlg.m_sPW1;
611+ password = passDlg.m_sPw1;
612612 }
613613 else
614614 {
--- trunk/src/TortoiseProc/CreateChangelistDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/CreateChangelistDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2011, 2014, 2020 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2011, 2014, 2020-2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,11 +17,9 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "CreateChangelistDlg.h"
2221 #include "AppUtils.h"
2322
24-
2523 // CCreateChangelistDlg dialog
2624
2725 IMPLEMENT_DYNAMIC(CCreateChangelistDlg, CStandAloneDialog)
@@ -29,7 +27,6 @@
2927 CCreateChangelistDlg::CCreateChangelistDlg(CWnd* pParent /*=NULL*/)
3028 : CStandAloneDialog(CCreateChangelistDlg::IDD, pParent)
3129 {
32-
3330 }
3431
3532 CCreateChangelistDlg::~CCreateChangelistDlg()
@@ -42,12 +39,10 @@
4239 DDX_Text(pDX, IDC_NAME, m_sName);
4340 }
4441
45-
4642 BEGIN_MESSAGE_MAP(CCreateChangelistDlg, CStandAloneDialog)
4743 ON_EN_CHANGE(IDC_NAME, &CCreateChangelistDlg::OnEnChangeName)
4844 END_MESSAGE_MAP()
4945
50-
5146 // CCreateChangelistDlg message handlers
5247
5348 BOOL CCreateChangelistDlg::OnInitDialog()
--- trunk/src/TortoiseProc/CreateChangelistDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/CreateChangelistDlg.h (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2008, 2020 - TortoiseSVN
3+// Copyright (C) 2003-2008, 2020-2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -19,7 +19,6 @@
1919 #pragma once
2020 #include "StandAloneDlg.h"
2121
22-
2322 /**
2423 * \ingroup TortoiseProc
2524 * Helper dialog to get the name of a change list.
@@ -29,14 +28,17 @@
2928 DECLARE_DYNAMIC(CCreateChangelistDlg)
3029
3130 public:
32- CCreateChangelistDlg(CWnd* pParent = NULL); // standard constructor
33- virtual ~CCreateChangelistDlg();
31+ CCreateChangelistDlg(CWnd* pParent = nullptr); // standard constructor
32+ ~CCreateChangelistDlg() override;
3433
35- enum { IDD = IDD_CREATECHANGELIST };
34+ enum
35+ {
36+ IDD = IDD_CREATECHANGELIST
37+ };
3638
3739 protected:
38- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
39- virtual BOOL OnInitDialog();
40+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
41+ BOOL OnInitDialog() override;
4042 afx_msg void OnEnChangeName();
4143
4244 DECLARE_MESSAGE_MAP()
--- trunk/src/TortoiseProc/DiffOptionsDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/DiffOptionsDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2011, 2013, 2016, 2018 - TortoiseSVN
3+// Copyright (C) 2011, 2013, 2016, 2018, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,9 +17,7 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "DiffOptionsDlg.h"
22-#include <afxdialogex.h>
2321 #include "SVN.h"
2422
2523 // CDiffOptionsDlg dialog
@@ -33,7 +31,6 @@
3331 , m_bIgnoreAllWhitespaces(FALSE)
3432 , m_bPrettyPrint(TRUE)
3533 {
36-
3734 }
3835
3936 CDiffOptionsDlg::~CDiffOptionsDlg()
@@ -49,33 +46,32 @@
4946 DDX_Check(pDX, IDC_PRETTYPRINT, m_bPrettyPrint);
5047 }
5148
52-
5349 BEGIN_MESSAGE_MAP(CDiffOptionsDlg, CStandAloneDialog)
5450 END_MESSAGE_MAP()
5551
56-void CDiffOptionsDlg::SetDiffOptions(const SVNDiffOptions & opts)
52+void CDiffOptionsDlg::SetDiffOptions(const SVNDiffOptions& opts)
5753 {
5854 m_bIgnoreEOLs = opts.GetIgnoreEOL();
59- switch(opts.GetIgnoreSpace())
55+ switch (opts.GetIgnoreSpace())
6056 {
61- case svn_diff_file_ignore_space_none:
62- m_bIgnoreWhitespaces = FALSE;
63- m_bIgnoreAllWhitespaces = FALSE;
64- break;
57+ case svn_diff_file_ignore_space_none:
58+ m_bIgnoreWhitespaces = FALSE;
59+ m_bIgnoreAllWhitespaces = FALSE;
60+ break;
6561
66- case svn_diff_file_ignore_space_change:
67- m_bIgnoreWhitespaces = TRUE;
68- m_bIgnoreAllWhitespaces = FALSE;
69- break;
62+ case svn_diff_file_ignore_space_change:
63+ m_bIgnoreWhitespaces = TRUE;
64+ m_bIgnoreAllWhitespaces = FALSE;
65+ break;
7066
71- case svn_diff_file_ignore_space_all:
72- m_bIgnoreWhitespaces = FALSE;
73- m_bIgnoreAllWhitespaces = TRUE;
74- break;
67+ case svn_diff_file_ignore_space_all:
68+ m_bIgnoreWhitespaces = FALSE;
69+ m_bIgnoreAllWhitespaces = TRUE;
70+ break;
7571 }
7672 }
7773
78-SVNDiffOptions CDiffOptionsDlg::GetDiffOptions()
74+SVNDiffOptions CDiffOptionsDlg::GetDiffOptions() const
7975 {
8076 SVNDiffOptions result;
8177
@@ -95,7 +91,7 @@
9591 {
9692 CStandAloneDialog::OnInitDialog();
9793
98- ExtendFrameIntoClientArea(0,0,0,0);
94+ ExtendFrameIntoClientArea(0, 0, 0, 0);
9995 m_aeroControls.SubclassControl(this, IDC_IGNOREEOL);
10096 m_aeroControls.SubclassControl(this, IDC_IGNOREWHITESPACE);
10197 m_aeroControls.SubclassControl(this, IDC_IGNOREALLWHITESPACE);
--- trunk/src/TortoiseProc/DiffOptionsDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/DiffOptionsDlg.h (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2011, 2016, 2018 - TortoiseSVN
3+// Copyright (C) 2011, 2016, 2018, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -28,20 +28,23 @@
2828 DECLARE_DYNAMIC(CDiffOptionsDlg)
2929
3030 public:
31- CDiffOptionsDlg(CWnd* pParent = NULL); // standard constructor
32- virtual ~CDiffOptionsDlg();
31+ CDiffOptionsDlg(CWnd* pParent = nullptr); // standard constructor
32+ ~CDiffOptionsDlg() override;
3333
34- enum { IDD = IDD_DIFFOPTIONS };
34+ enum
35+ {
36+ IDD = IDD_DIFFOPTIONS
37+ };
3538
36- void SetDiffOptions(const SVNDiffOptions & opts);
37- void SetPrettyPrint(bool prettyprint) { m_bPrettyPrint = prettyprint; }
38- SVNDiffOptions GetDiffOptions();
39- CString GetDiffOptionsString() { return GetDiffOptions().GetOptionsString(); }
40- bool GetPrettyPrint() const { return !!m_bPrettyPrint; }
39+ void SetDiffOptions(const SVNDiffOptions& opts);
40+ void SetPrettyPrint(bool prettyprint) { m_bPrettyPrint = prettyprint; }
41+ SVNDiffOptions GetDiffOptions() const;
42+ CString GetDiffOptionsString() const { return GetDiffOptions().GetOptionsString(); }
43+ bool GetPrettyPrint() const { return !!m_bPrettyPrint; }
4144
4245 protected:
43- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
44- virtual BOOL OnInitDialog();
46+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
47+ BOOL OnInitDialog() override;
4548
4649 DECLARE_MESSAGE_MAP()
4750
--- trunk/src/TortoiseProc/FileDiffDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/FileDiffDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2018, 2020 - TortoiseSVN
3+// Copyright (C) 2003-2018, 2020-2021 - TortoiseSVN
44 // Copyright (C) 2019 - TortoiseGit
55
66 // This program is free software; you can redistribute it and/or
@@ -18,7 +18,6 @@
1818 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1919 //
2020 #include "stdafx.h"
21-#include "TortoiseProc.h"
2221 #include "UnicodeUtils.h"
2322 #include "AppUtils.h"
2423 #include "TempFile.h"
@@ -47,10 +46,10 @@
4746 ID_LOG,
4847 };
4948
50-#define COL1WIDTH 200
49+#define COL1_WIDTH 200
5150
52-BOOL CFileDiffDlg::m_bAscending = FALSE;
53-int CFileDiffDlg::m_nSortedColumn = -1;
51+BOOL CFileDiffDlg::m_bAscending = FALSE;
52+int CFileDiffDlg::m_nSortedColumn = -1;
5453
5554 CString sContentOnly;
5655 CString sPropertiesOnly;
@@ -58,21 +57,20 @@
5857
5958 bool s_bSortLogical = true;
6059
61-
6260 IMPLEMENT_DYNAMIC(CFileDiffDlg, CResizableStandAloneDialog)
6361 CFileDiffDlg::CFileDiffDlg(CWnd* pParent /*=NULL*/)
6462 : CResizableStandAloneDialog(CFileDiffDlg::IDD, pParent)
6563 , m_bBlame(false)
66- , m_pProgDlg(NULL)
67- , m_bCancelled(false)
68- , netScheduler(1, 0, true)
64+ , m_pProgDlg(nullptr)
6965 , m_nIconFolder(0)
66+ , m_depth(svn_depth_unknown)
7067 , m_bIgnoreancestry(false)
7168 , m_bDoPegDiff(false)
7269 , m_bThreadRunning(false)
73- , m_depth(svn_depth_unknown)
70+ , netScheduler(1, 0, true)
71+ , m_bCancelled(false)
7472 {
75- m_columnbuf[0] = 0;
73+ m_columnBuf[0] = 0;
7674 s_bSortLogical = !CRegDWORD(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoStrCmpLogical", 0, false, HKEY_CURRENT_USER);
7775 if (s_bSortLogical)
7876 s_bSortLogical = !CRegDWORD(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoStrCmpLogical", 0, false, HKEY_LOCAL_MACHINE);
@@ -86,13 +84,12 @@
8684 {
8785 CResizableStandAloneDialog::DoDataExchange(pDX);
8886 DDX_Control(pDX, IDC_FILELIST, m_cFileList);
89- DDX_Control(pDX, IDC_SWITCHLEFTRIGHT, m_SwitchButton);
87+ DDX_Control(pDX, IDC_SWITCHLEFTRIGHT, m_switchButton);
9088 DDX_Control(pDX, IDC_REV1BTN, m_cRev1Btn);
9189 DDX_Control(pDX, IDC_REV2BTN, m_cRev2Btn);
9290 DDX_Control(pDX, IDC_FILTER, m_cFilter);
9391 }
9492
95-
9693 BEGIN_MESSAGE_MAP(CFileDiffDlg, CResizableStandAloneDialog)
9794 ON_NOTIFY(NM_DBLCLK, IDC_FILELIST, OnNMDblclkFilelist)
9895 ON_NOTIFY(LVN_GETINFOTIP, IDC_FILELIST, OnLvnGetInfoTipFilelist)
@@ -112,27 +109,26 @@
112109 ON_WM_SETFOCUS()
113110 END_MESSAGE_MAP()
114111
115-
116112 void CFileDiffDlg::SetDiff(const CTSVNPath& path, const SVNRev& peg, const SVNRev& rev1, const SVNRev& rev2, svn_depth_t depth, bool ignoreancestry)
117113 {
118- m_bDoPegDiff = true;
119- m_path1 = path;
120- m_path2 = path;
121- m_peg = peg;
122- m_rev1 = rev1;
123- m_rev2 = rev2;
124- m_depth = depth;
114+ m_bDoPegDiff = true;
115+ m_path1 = path;
116+ m_path2 = path;
117+ m_peg = peg;
118+ m_rev1 = rev1;
119+ m_rev2 = rev2;
120+ m_depth = depth;
125121 m_bIgnoreancestry = ignoreancestry;
126122 }
127123
128124 void CFileDiffDlg::SetDiff(const CTSVNPath& path1, const SVNRev& rev1, const CTSVNPath& path2, const SVNRev& rev2, svn_depth_t depth, bool ignoreancestry)
129125 {
130- m_bDoPegDiff = false;
131- m_path1 = path1;
132- m_path2 = path2;
133- m_rev1 = rev1;
134- m_rev2 = rev2;
135- m_depth = depth;
126+ m_bDoPegDiff = false;
127+ m_path1 = path1;
128+ m_path2 = path2;
129+ m_rev1 = rev1;
130+ m_rev2 = rev2;
131+ m_depth = depth;
136132 m_bIgnoreancestry = ignoreancestry;
137133 }
138134
@@ -152,19 +148,19 @@
152148 m_nIconFolder = SYS_IMAGE_LIST().GetDirIconIndex();
153149 m_cFileList.SetImageList(&SYS_IMAGE_LIST(), LVSIL_SMALL);
154150
155- int iconWidth = GetSystemMetrics(SM_CXSMICON);
151+ int iconWidth = GetSystemMetrics(SM_CXSMICON);
156152 int iconHeight = GetSystemMetrics(SM_CYSMICON);
157- m_SwitchButton.SetImage(CCommonAppUtils::LoadIconEx(IDI_SWITCHLEFTRIGHT, iconWidth, iconHeight));
158- m_SwitchButton.Invalidate();
153+ m_switchButton.SetImage(CCommonAppUtils::LoadIconEx(IDI_SWITCHLEFTRIGHT, iconWidth, iconHeight));
154+ m_switchButton.Invalidate();
159155
160156 m_cFilter.SetCancelBitmaps(IDI_CANCELNORMAL, IDI_CANCELPRESSED, 14, 14);
161157 m_cFilter.SetInfoIcon(IDI_FILTEREDIT, 19, 19);
162158 temp.LoadString(IDS_FILEDIFF_FILTERCUE);
163- temp = L" "+temp;
159+ temp = L" " + temp;
164160 m_cFilter.SetCueBanner(temp);
165161
166- int c = m_cFileList.GetHeaderCtrl()->GetItemCount()-1;
167- while (c>=0)
162+ int c = m_cFileList.GetHeaderCtrl()->GetItemCount() - 1;
163+ while (c >= 0)
168164 m_cFileList.DeleteColumn(c--);
169165 temp.LoadString(IDS_FILEDIFF_FILE);
170166 m_cFileList.InsertColumn(0, temp);
@@ -173,8 +169,8 @@
173169
174170 CRect rect;
175171 m_cFileList.GetClientRect(&rect);
176- m_cFileList.SetColumnWidth(0, rect.Width()-COL1WIDTH-20);
177- m_cFileList.SetColumnWidth(1, COL1WIDTH);
172+ m_cFileList.SetColumnWidth(0, rect.Width() - COL1_WIDTH - 20);
173+ m_cFileList.SetColumnWidth(1, COL1_WIDTH);
178174
179175 m_cFileList.SetRedraw(true);
180176
@@ -190,17 +186,17 @@
190186
191187 SetURLLabels();
192188
193- sContentOnly = CString(MAKEINTRESOURCE(IDS_CONTENTONLY));
194- sPropertiesOnly = CString(MAKEINTRESOURCE(IDS_PROPONLY));
195- sContentAndProps = CString(MAKEINTRESOURCE(IDS_CONTENTANDPROP));
189+ sContentOnly = CString(MAKEINTRESOURCE(IDS_CONTENTONLY));
190+ sPropertiesOnly = CString(MAKEINTRESOURCE(IDS_PROPONLY));
191+ sContentAndProps = CString(MAKEINTRESOURCE(IDS_CONTENTANDPROP));
196192
197193 EnableSaveRestore(L"FileDiffDlg");
198194
199195 InterlockedExchange(&m_bThreadRunning, TRUE);
200- if (AfxBeginThread(DiffThreadEntry, this)==NULL)
196+ if (AfxBeginThread(DiffThreadEntry, this) == nullptr)
201197 {
202198 InterlockedExchange(&m_bThreadRunning, FALSE);
203- TaskDialog(GetSafeHwnd(), AfxGetResourceHandle(), MAKEINTRESOURCE(IDS_APPNAME), MAKEINTRESOURCE(IDS_ERR_ERROROCCURED), MAKEINTRESOURCE(IDS_ERR_THREADSTARTFAILED), TDCBF_OK_BUTTON, TD_ERROR_ICON, NULL);
199+ TaskDialog(GetSafeHwnd(), AfxGetResourceHandle(), MAKEINTRESOURCE(IDS_APPNAME), MAKEINTRESOURCE(IDS_ERR_ERROROCCURED), MAKEINTRESOURCE(IDS_ERR_THREADSTARTFAILED), TDCBF_OK_BUTTON, TD_ERROR_ICON, nullptr);
204200 }
205201
206202 // Start with focus on file list
@@ -208,23 +204,23 @@
208204 return FALSE;
209205 }
210206
211-svn_error_t* CFileDiffDlg::DiffSummarizeCallback(const CTSVNPath& path,
207+svn_error_t* CFileDiffDlg::DiffSummarizeCallback(const CTSVNPath& path,
212208 svn_client_diff_summarize_kind_t kind,
213209 bool propchanged, svn_node_kind_t node)
214210 {
215211 FileDiff fd;
216- fd.path = path;
217- fd.kind = kind;
218- fd.node = node;
212+ fd.path = path;
213+ fd.kind = kind;
214+ fd.node = node;
219215 fd.propchanged = propchanged;
220216 m_arFileList.push_back(fd);
221- return SVN_NO_ERROR;
217+ return nullptr;
222218 }
223219
224220 UINT CFileDiffDlg::DiffThreadEntry(LPVOID pVoid)
225221 {
226- CCrashReportThread crashthread;
227- return ((CFileDiffDlg*)pVoid)->DiffThread();
222+ CCrashReportThread crashThread;
223+ return static_cast<CFileDiffDlg*>(pVoid)->DiffThread();
228224 }
229225
230226 UINT CFileDiffDlg::DiffThread()
@@ -252,7 +248,7 @@
252248 m_cFilter.GetWindowText(sFilterText);
253249 m_cFileList.SetRedraw(false);
254250 Filter(sFilterText);
255- if (! m_arFileList.empty())
251+ if (!m_arFileList.empty())
256252 {
257253 // Highlight first entry in file list
258254 m_cFileList.SetSelectionMark(0);
@@ -261,14 +257,14 @@
261257
262258 CRect rect;
263259 m_cFileList.GetClientRect(&rect);
264- m_cFileList.SetColumnWidth(0, rect.Width()-COL1WIDTH-20);
265- m_cFileList.SetColumnWidth(1, COL1WIDTH);
260+ m_cFileList.SetColumnWidth(0, rect.Width() - COL1_WIDTH - 20);
261+ m_cFileList.SetColumnWidth(1, COL1_WIDTH);
266262
267263 m_cFileList.ClearText();
268264 m_cFileList.SetRedraw(true);
269265
270266 InterlockedExchange(&m_bThreadRunning, FALSE);
271- InvalidateRect(NULL);
267+ InvalidateRect(nullptr);
272268 RefreshCursor();
273269 return 0;
274270 }
@@ -298,75 +294,75 @@
298294 if (!bText)
299295 return;
300296
301- CTSVNPath tempfile = CTempFiles::Instance().GetTempFilePath(false, m_path1, m_rev1);
297+ CTSVNPath tempFile = CTempFiles::Instance().GetTempFilePath(false, m_path1, m_rev1);
302298 CProgressDlg progDlg;
303299 progDlg.SetTitle(IDS_PROGRESSWAIT);
304300 progDlg.ShowModeless(this);
305- progDlg.FormatPathLine(1, IDS_PROGRESSGETFILE, (LPCTSTR)url1.GetUIFileOrDirectoryName());
306- progDlg.FormatNonPathLine(2, IDS_PROGRESSREVISIONTEXT, (LPCTSTR)m_rev1.ToString());
301+ progDlg.FormatPathLine(1, IDS_PROGRESSGETFILE, static_cast<LPCWSTR>(url1.GetUIFileOrDirectoryName()));
302+ progDlg.FormatNonPathLine(2, IDS_PROGRESSREVISIONTEXT, static_cast<LPCWSTR>(m_rev1.ToString()));
307303 SetAndClearProgressInfo(&progDlg);
308304 m_blamer.SetAndClearProgressInfo(&progDlg, 3, false);
309- if ((fd.kind != svn_client_diff_summarize_kind_added)&&(!blame)&&(!Export(url1, tempfile, m_bDoPegDiff ? m_peg : m_rev1, m_rev1)))
305+ if ((fd.kind != svn_client_diff_summarize_kind_added) && (!blame) && (!Export(url1, tempFile, m_bDoPegDiff ? m_peg : m_rev1, m_rev1)))
310306 {
311- if ((!m_bDoPegDiff)||(!Export(url1, tempfile, m_rev1, m_rev1)))
307+ if ((!m_bDoPegDiff) || (!Export(url1, tempFile, m_rev1, m_rev1)))
312308 {
313- SetAndClearProgressInfo((HWND)NULL);
314- m_blamer.SetAndClearProgressInfo(NULL, 3);
309+ SetAndClearProgressInfo(static_cast<HWND>(nullptr));
310+ m_blamer.SetAndClearProgressInfo(nullptr, 3);
315311 ShowErrorDialog(m_hWnd);
316312 return;
317313 }
318314 }
319- else if ((fd.kind != svn_client_diff_summarize_kind_added)&&(blame)&&(!m_blamer.BlameToFile(url1, 1, m_rev1, m_bDoPegDiff ? m_peg : m_rev1, tempfile, L"", TRUE, TRUE)))
315+ else if ((fd.kind != svn_client_diff_summarize_kind_added) && (blame) && (!m_blamer.BlameToFile(url1, 1, m_rev1, m_bDoPegDiff ? m_peg : m_rev1, tempFile, L"", TRUE, TRUE)))
320316 {
321- if ((!m_bDoPegDiff)||(!m_blamer.BlameToFile(url1, 1, m_rev1, m_rev1, tempfile, L"", TRUE, TRUE)))
317+ if ((!m_bDoPegDiff) || (!m_blamer.BlameToFile(url1, 1, m_rev1, m_rev1, tempFile, L"", TRUE, TRUE)))
322318 {
323- SetAndClearProgressInfo((HWND)NULL);
324- m_blamer.SetAndClearProgressInfo(NULL, 3);
319+ SetAndClearProgressInfo(static_cast<HWND>(nullptr));
320+ m_blamer.SetAndClearProgressInfo(nullptr, 3);
325321 m_blamer.ShowErrorDialog(m_hWnd);
326322 return;
327323 }
328324 }
329- SetFileAttributes(tempfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
325+ SetFileAttributes(tempFile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
330326 progDlg.SetProgress(1, 2);
331- progDlg.FormatPathLine(1, IDS_PROGRESSGETFILE, (LPCTSTR)url2.GetUIFileOrDirectoryName());
332- progDlg.FormatNonPathLine(2, IDS_PROGRESSREVISIONTEXT, (LPCTSTR)m_rev2.ToString());
327+ progDlg.FormatPathLine(1, IDS_PROGRESSGETFILE, static_cast<LPCWSTR>(url2.GetUIFileOrDirectoryName()));
328+ progDlg.FormatNonPathLine(2, IDS_PROGRESSREVISIONTEXT, static_cast<LPCWSTR>(m_rev2.ToString()));
333329 CTSVNPath tempfile2 = CTempFiles::Instance().GetTempFilePath(false, url2, m_rev2);
334- if ((fd.kind != svn_client_diff_summarize_kind_deleted)&&(!blame)&&(!Export(url2, tempfile2, m_bDoPegDiff ? m_peg : m_rev2, m_rev2)))
330+ if ((fd.kind != svn_client_diff_summarize_kind_deleted) && (!blame) && (!Export(url2, tempfile2, m_bDoPegDiff ? m_peg : m_rev2, m_rev2)))
335331 {
336- if ((!m_bDoPegDiff)||(!Export(url2, tempfile2, m_rev2, m_rev2)))
332+ if ((!m_bDoPegDiff) || (!Export(url2, tempfile2, m_rev2, m_rev2)))
337333 {
338- SetAndClearProgressInfo((HWND)NULL);
339- m_blamer.SetAndClearProgressInfo(NULL, 3);
334+ SetAndClearProgressInfo(static_cast<HWND>(nullptr));
335+ m_blamer.SetAndClearProgressInfo(nullptr, 3);
340336 ShowErrorDialog(m_hWnd);
341337 return;
342338 }
343339 }
344- else if ((fd.kind != svn_client_diff_summarize_kind_deleted)&&(blame)&&(!m_blamer.BlameToFile(url2, 1, m_bDoPegDiff ? m_peg : m_rev2, m_rev2, tempfile2, L"", TRUE, TRUE)))
340+ else if ((fd.kind != svn_client_diff_summarize_kind_deleted) && (blame) && (!m_blamer.BlameToFile(url2, 1, m_bDoPegDiff ? m_peg : m_rev2, m_rev2, tempfile2, L"", TRUE, TRUE)))
345341 {
346- if ((!m_bDoPegDiff)||(!m_blamer.BlameToFile(url2, 1, m_rev2, m_rev2, tempfile2, L"", TRUE, TRUE)))
342+ if ((!m_bDoPegDiff) || (!m_blamer.BlameToFile(url2, 1, m_rev2, m_rev2, tempfile2, L"", TRUE, TRUE)))
347343 {
348- SetAndClearProgressInfo((HWND)NULL);
349- m_blamer.SetAndClearProgressInfo(NULL, 3);
344+ SetAndClearProgressInfo(static_cast<HWND>(nullptr));
345+ m_blamer.SetAndClearProgressInfo(nullptr, 3);
350346 m_blamer.ShowErrorDialog(m_hWnd);
351347 return;
352348 }
353349 }
354350 SetFileAttributes(tempfile2.GetWinPath(), FILE_ATTRIBUTE_READONLY);
355- progDlg.SetProgress(2,2);
351+ progDlg.SetProgress(2, 2);
356352 progDlg.Stop();
357- SetAndClearProgressInfo((HWND)NULL);
358- m_blamer.SetAndClearProgressInfo(NULL, 3);
353+ SetAndClearProgressInfo(static_cast<HWND>(nullptr));
354+ m_blamer.SetAndClearProgressInfo(nullptr, 3);
359355
360- CString rev1name, rev2name;
356+ CString rev1Name, rev2Name;
361357 if (m_bDoPegDiff)
362358 {
363- rev1name.Format(L"%s Revision %ld", (LPCTSTR)fd.path.GetSVNPathString(), (LONG)m_rev1);
364- rev2name.Format(L"%s Revision %ld", (LPCTSTR)fd.path.GetSVNPathString(), (LONG)m_rev2);
359+ rev1Name.Format(L"%s Revision %ld", static_cast<LPCWSTR>(fd.path.GetSVNPathString()), static_cast<LONG>(m_rev1));
360+ rev2Name.Format(L"%s Revision %ld", static_cast<LPCWSTR>(fd.path.GetSVNPathString()), static_cast<LONG>(m_rev2));
365361 }
366362 else
367363 {
368- rev1name = m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString();
369- rev2name = m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString();
364+ rev1Name = m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString();
365+ rev2Name = m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString();
370366 }
371367 CAppUtils::DiffFlags flags;
372368 flags.AlternativeTool(!!(GetAsyncKeyState(VK_SHIFT) & 0x8000));
@@ -375,7 +371,7 @@
375371 if (!blame)
376372 CAppUtils::GetMimeType(url1, mimetype, m_rev1);
377373 CAppUtils::StartExtDiff(
378- tempfile, tempfile2, rev1name, rev2name, url1, url2, m_rev1, m_rev2, m_bDoPegDiff ? m_peg : SVNRev(), flags, 0, L"", mimetype);
374+ tempFile, tempfile2, rev1Name, rev2Name, url1, url2, m_rev1, m_rev2, m_bDoPegDiff ? m_peg : SVNRev(), flags, 0, L"", mimetype);
379375 }
380376
381377 void CFileDiffDlg::DiffProps(int selIndex)
@@ -385,25 +381,25 @@
385381 CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
386382 CTSVNPath url2 = m_bDoPegDiff ? url1 : CTSVNPath(m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
387383
388- SVNProperties propsurl1(url1, m_rev1, false, false);
389- SVNProperties propsurl2(url2, m_rev2, false, false);
384+ SVNProperties propsUrl1(url1, m_rev1, false, false);
385+ SVNProperties propsUrl2(url2, m_rev2, false, false);
390386
391387 // collect the properties of both revisions in a set
392388 std::set<std::string> properties;
393- for (int wcindex = 0; wcindex < propsurl1.GetCount(); ++wcindex)
389+ for (int wcIndex = 0; wcIndex < propsUrl1.GetCount(); ++wcIndex)
394390 {
395- std::string urlname = propsurl1.GetItemName(wcindex);
396- if ( properties.find(urlname) == properties.end() )
391+ std::string urlName = propsUrl1.GetItemName(wcIndex);
392+ if (properties.find(urlName) == properties.end())
397393 {
398- properties.insert(urlname);
394+ properties.insert(urlName);
399395 }
400396 }
401- for (int wcindex = 0; wcindex < propsurl2.GetCount(); ++wcindex)
397+ for (int wcIndex = 0; wcIndex < propsUrl2.GetCount(); ++wcIndex)
402398 {
403- std::string urlname = propsurl2.GetItemName(wcindex);
404- if ( properties.find(urlname) == properties.end() )
399+ std::string urlName = propsUrl2.GetItemName(wcIndex);
400+ if (properties.find(urlName) == properties.end())
405401 {
406- properties.insert(urlname);
402+ properties.insert(urlName);
407403 }
408404 }
409405
@@ -410,42 +406,42 @@
410406 // iterate over all properties and diff the properties
411407 for (std::set<std::string>::iterator iter = properties.begin(), end = properties.end(); iter != end; ++iter)
412408 {
413- const std::string& url1name = *iter;
409+ const std::string& url1Name = *iter;
414410
415- tstring url1value = L""; // CUnicodeUtils::StdGetUnicode((char *)propsurl1.GetItemValue(wcindex).c_str());
416- for (int url1index = 0; url1index < propsurl1.GetCount(); ++url1index)
411+ tstring url1Value = L""; // CUnicodeUtils::StdGetUnicode((char *)propsurl1.GetItemValue(wcindex).c_str());
412+ for (int url1Index = 0; url1Index < propsUrl1.GetCount(); ++url1Index)
417413 {
418- if (propsurl1.GetItemName(url1index).compare(url1name)==0)
414+ if (propsUrl1.GetItemName(url1Index).compare(url1Name) == 0)
419415 {
420- url1value = CUnicodeUtils::GetUnicode(propsurl1.GetItemValue(url1index).c_str());
416+ url1Value = CUnicodeUtils::GetUnicode(propsUrl1.GetItemValue(url1Index).c_str());
421417 }
422418 }
423419
424- tstring url2value = L"";
425- for (int url2index = 0; url2index < propsurl2.GetCount(); ++url2index)
420+ std::wstring url2Value = L"";
421+ for (int url2Index = 0; url2Index < propsUrl2.GetCount(); ++url2Index)
426422 {
427- if (propsurl2.GetItemName(url2index).compare(url1name)==0)
423+ if (propsUrl2.GetItemName(url2Index).compare(url1Name) == 0)
428424 {
429- url2value = CUnicodeUtils::GetUnicode(propsurl2.GetItemValue(url2index).c_str());
425+ url2Value = CUnicodeUtils::GetUnicode(propsUrl2.GetItemValue(url2Index).c_str());
430426 }
431427 }
432428
433- if (url2value.compare(url1value)!=0)
429+ if (url2Value.compare(url1Value) != 0)
434430 {
435431 // write both property values to temporary files
436- CTSVNPath url1propfile = CTempFiles::Instance().GetTempFilePath(false);
437- CTSVNPath url2propfile = CTempFiles::Instance().GetTempFilePath(false);
438- FILE * pFile;
439- _tfopen_s(&pFile, url1propfile.GetWinPath(), L"wb");
432+ CTSVNPath url1Propfile = CTempFiles::Instance().GetTempFilePath(false);
433+ CTSVNPath url2Propfile = CTempFiles::Instance().GetTempFilePath(false);
434+ FILE* pFile;
435+ _tfopen_s(&pFile, url1Propfile.GetWinPath(), L"wb");
440436 if (pFile)
441437 {
442- fputs(CUnicodeUtils::StdGetUTF8(url1value).c_str(), pFile);
438+ fputs(CUnicodeUtils::StdGetUTF8(url1Value).c_str(), pFile);
443439 fclose(pFile);
444- FILE * pFile2;
445- _tfopen_s(&pFile2, url2propfile.GetWinPath(), L"wb");
440+ FILE* pFile2;
441+ _tfopen_s(&pFile2, url2Propfile.GetWinPath(), L"wb");
446442 if (pFile2)
447443 {
448- fputs(CUnicodeUtils::StdGetUTF8(url2value).c_str(), pFile2);
444+ fputs(CUnicodeUtils::StdGetUTF8(url2Value).c_str(), pFile2);
449445 fclose(pFile2);
450446 }
451447 else
@@ -453,56 +449,56 @@
453449 }
454450 else
455451 return;
456- SetFileAttributes(url1propfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
457- SetFileAttributes(url2propfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
452+ SetFileAttributes(url1Propfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
453+ SetFileAttributes(url2Propfile.GetWinPath(), FILE_ATTRIBUTE_READONLY);
458454 CString n1, n2;
459455 if (m_rev1.IsWorking())
460- n1.Format(IDS_DIFF_WCNAME, CUnicodeUtils::StdGetUnicode(url1name).c_str());
456+ n1.Format(IDS_DIFF_WCNAME, CUnicodeUtils::StdGetUnicode(url1Name).c_str());
461457 if (m_rev1.IsBase())
462- n1.Format(IDS_DIFF_BASENAME, CUnicodeUtils::StdGetUnicode(url1name).c_str());
458+ n1.Format(IDS_DIFF_BASENAME, CUnicodeUtils::StdGetUnicode(url1Name).c_str());
463459 if (m_rev1.IsHead() || m_rev1.IsNumber())
464460 {
465461 if (m_bDoPegDiff)
466462 {
467- n1.Format(L"%s : %s Revision %ld", CUnicodeUtils::StdGetUnicode(url1name).c_str(), (LPCTSTR)fd.path.GetSVNPathString(), (LONG)m_rev1);
463+ n1.Format(L"%s : %s Revision %ld", CUnicodeUtils::StdGetUnicode(url1Name).c_str(), static_cast<LPCWSTR>(fd.path.GetSVNPathString()), static_cast<LONG>(m_rev1));
468464 }
469465 else
470466 {
471- CString sTemp (CUnicodeUtils::StdGetUnicode(url1name).c_str());
467+ CString sTemp(CUnicodeUtils::StdGetUnicode(url1Name).c_str());
472468 sTemp += L" : ";
473469 n1 = sTemp + m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString();
474470 }
475471 }
476472 if (m_rev2.IsWorking())
477- n2.Format(IDS_DIFF_WCNAME, CUnicodeUtils::StdGetUnicode(url1name).c_str());
473+ n2.Format(IDS_DIFF_WCNAME, CUnicodeUtils::StdGetUnicode(url1Name).c_str());
478474 if (m_rev2.IsBase())
479- n2.Format(IDS_DIFF_BASENAME, CUnicodeUtils::StdGetUnicode(url1name).c_str());
475+ n2.Format(IDS_DIFF_BASENAME, CUnicodeUtils::StdGetUnicode(url1Name).c_str());
480476 if (m_rev2.IsHead() || m_rev2.IsNumber())
481477 {
482478 if (m_bDoPegDiff)
483479 {
484- n2.Format(L"%s : %s Revision %ld", CUnicodeUtils::StdGetUnicode(url1name).c_str(), (LPCTSTR)fd.path.GetSVNPathString(), (LONG)m_rev2);
480+ n2.Format(L"%s : %s Revision %ld", CUnicodeUtils::StdGetUnicode(url1Name).c_str(), static_cast<LPCWSTR>(fd.path.GetSVNPathString()), static_cast<LONG>(m_rev2));
485481 }
486482 else
487483 {
488- CString sTemp (CUnicodeUtils::StdGetUnicode (url1name).c_str());
484+ CString sTemp(CUnicodeUtils::StdGetUnicode(url1Name).c_str());
489485 sTemp += L" : ";
490486 n2 = sTemp + m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString();
491487 }
492488 }
493- CAppUtils::StartExtDiffProps(url1propfile, url2propfile, n1, n2, TRUE);
489+ CAppUtils::StartExtDiffProps(url1Propfile, url2Propfile, n1, n2, TRUE);
494490 }
495491 }
496492 }
497493
498-void CFileDiffDlg::OnNMDblclkFilelist(NMHDR *pNMHDR, LRESULT *pResult)
494+void CFileDiffDlg::OnNMDblclkFilelist(NMHDR* pNMHDR, LRESULT* pResult)
499495 {
500- *pResult = 0;
501- LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
502- int selIndex = pNMLV->iItem;
496+ *pResult = 0;
497+ LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
498+ int selIndex = pNMLV->iItem;
503499 if (selIndex < 0)
504500 return;
505- if (selIndex >= (int)m_arFilteredList.size())
501+ if (selIndex >= static_cast<int>(m_arFilteredList.size()))
506502 return;
507503
508504 CFileDiffDlg::FileDiff fd = m_arFilteredList[selIndex];
@@ -514,23 +510,23 @@
514510 DoDiff(selIndex, true, false, m_bBlame, true);
515511 }
516512
517-void CFileDiffDlg::OnLvnGetInfoTipFilelist(NMHDR *pNMHDR, LRESULT *pResult)
513+void CFileDiffDlg::OnLvnGetInfoTipFilelist(NMHDR* pNMHDR, LRESULT* pResult)
518514 {
519- *pResult = 0;
515+ *pResult = 0;
520516 LPNMLVGETINFOTIP pGetInfoTip = reinterpret_cast<LPNMLVGETINFOTIP>(pNMHDR);
521517 if (pGetInfoTip->dwFlags & LVGIT_UNFOLDED)
522518 return; // only show infotip if the item isn't fully visible
523- if (pGetInfoTip->iItem >= (int)m_arFilteredList.size())
519+ if (pGetInfoTip->iItem >= static_cast<int>(m_arFilteredList.size()))
524520 return;
525521
526522 CString path = m_path1.GetSVNPathString() + L"/" + m_arFilteredList[pGetInfoTip->iItem].path.GetSVNPathString();
527523 if (pGetInfoTip->cchTextMax > path.GetLength())
528- wcsncpy_s(pGetInfoTip->pszText, pGetInfoTip->cchTextMax, path, pGetInfoTip->cchTextMax - 1);
524+ wcsncpy_s(pGetInfoTip->pszText, pGetInfoTip->cchTextMax, path, pGetInfoTip->cchTextMax - 1LL);
529525 }
530526
531-void CFileDiffDlg::OnNMCustomdrawFilelist(NMHDR *pNMHDR, LRESULT *pResult)
527+void CFileDiffDlg::OnNMCustomdrawFilelist(NMHDR* pNMHDR, LRESULT* pResult)
532528 {
533- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
529+ NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);
534530 // Take the default processing unless we set this to something else below.
535531 *pResult = CDRF_DODEFAULT;
536532
@@ -537,11 +533,11 @@
537533 // First thing - check the draw stage. If it's the control's prepaint
538534 // stage, then tell Windows we want messages for every item.
539535
540- if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
536+ if (CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage)
541537 {
542538 *pResult = CDRF_NOTIFYITEMDRAW;
543539 }
544- else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
540+ else if (CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage)
545541 {
546542 // This is the prepaint stage for an item. Here's where we set the
547543 // item's text color. Our return value will tell Windows to draw the
@@ -557,20 +553,20 @@
557553 FileDiff fd = m_arFilteredList[pLVCD->nmcd.dwItemSpec];
558554 switch (fd.kind)
559555 {
560- case svn_client_diff_summarize_kind_added:
561- crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::Added));
562- break;
563- case svn_client_diff_summarize_kind_deleted:
564- crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::Deleted));
565- break;
566- case svn_client_diff_summarize_kind_modified:
567- crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::Modified));
568- break;
569- case svn_client_diff_summarize_kind_normal:
570- default:
571- if (fd.propchanged)
572- crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::PropertyChanged));
573- break;
556+ case svn_client_diff_summarize_kind_added:
557+ crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::Added));
558+ break;
559+ case svn_client_diff_summarize_kind_deleted:
560+ crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::Deleted));
561+ break;
562+ case svn_client_diff_summarize_kind_modified:
563+ crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::Modified));
564+ break;
565+ case svn_client_diff_summarize_kind_normal:
566+ default:
567+ if (fd.propchanged)
568+ crText = CTheme::Instance().GetThemeColor(m_colors.GetColor(CColors::PropertyChanged));
569+ break;
574570 }
575571 }
576572 // Store the color back in the NMLVCUSTOMDRAW struct.
@@ -578,59 +574,59 @@
578574 }
579575 }
580576
581-void CFileDiffDlg::OnLvnGetdispinfoFilelist(NMHDR *pNMHDR, LRESULT *pResult)
577+void CFileDiffDlg::OnLvnGetdispinfoFilelist(NMHDR* pNMHDR, LRESULT* pResult)
582578 {
583- NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
579+ NMLVDISPINFO* pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
584580
585581 if (pDispInfo)
586582 {
587- if (pDispInfo->item.iItem < (int)m_arFilteredList.size())
583+ if (pDispInfo->item.iItem < static_cast<int>(m_arFilteredList.size()))
588584 {
589- const FileDiff * data = &m_arFilteredList[pDispInfo->item.iItem];
585+ const FileDiff* data = &m_arFilteredList[pDispInfo->item.iItem];
590586 if (pDispInfo->item.mask & LVIF_TEXT)
591587 {
592588 switch (pDispInfo->item.iSubItem)
593589 {
594- case 0: // path
590+ case 0: // path
595591 {
596- lstrcpyn(m_columnbuf, data->path.GetSVNPathString(), pDispInfo->item.cchTextMax - 1);
592+ lstrcpyn(m_columnBuf, data->path.GetSVNPathString(), pDispInfo->item.cchTextMax - 1LL);
597593 int cWidth = m_cFileList.GetColumnWidth(0);
598- cWidth = max(28, cWidth-28);
599- CDC * pDC = m_cFileList.GetDC();
600- if (pDC != NULL)
594+ cWidth = max(28, cWidth - 28);
595+ CDC* pDC = m_cFileList.GetDC();
596+ if (pDC != nullptr)
601597 {
602- CFont * pFont = pDC->SelectObject(m_cFileList.GetFont());
603- PathCompactPath(pDC->GetSafeHdc(), m_columnbuf, cWidth);
598+ CFont* pFont = pDC->SelectObject(m_cFileList.GetFont());
599+ PathCompactPath(pDC->GetSafeHdc(), m_columnBuf, cWidth);
604600 pDC->SelectObject(pFont);
605601 ReleaseDC(pDC);
606602 }
607603 }
608604 break;
609- case 1: // action
610- lstrcpyn(m_columnbuf, GetSummarizeActionText(data->kind), pDispInfo->item.cchTextMax - 1);
611- wcscat_s(m_columnbuf, L" ");
612- if ((data->kind != svn_client_diff_summarize_kind_normal)&&(!data->propchanged))
613- wcscat_s(m_columnbuf, sContentOnly);
614- else if (data->kind == svn_client_diff_summarize_kind_normal)
615- wcscat_s(m_columnbuf, sPropertiesOnly);
616- else
617- wcscat_s(m_columnbuf, sContentAndProps);
618- break;
619- default:
620- m_columnbuf[0] = 0;
605+ case 1: // action
606+ lstrcpyn(m_columnBuf, GetSummarizeActionText(data->kind), pDispInfo->item.cchTextMax - 1LL);
607+ wcscat_s(m_columnBuf, L" ");
608+ if ((data->kind != svn_client_diff_summarize_kind_normal) && (!data->propchanged))
609+ wcscat_s(m_columnBuf, sContentOnly);
610+ else if (data->kind == svn_client_diff_summarize_kind_normal)
611+ wcscat_s(m_columnBuf, sPropertiesOnly);
612+ else
613+ wcscat_s(m_columnBuf, sContentAndProps);
614+ break;
615+ default:
616+ m_columnBuf[0] = 0;
621617 }
622- pDispInfo->item.pszText = m_columnbuf;
618+ pDispInfo->item.pszText = m_columnBuf;
623619 }
624620 if (pDispInfo->item.mask & LVIF_IMAGE)
625621 {
626- int icon_idx = 0;
622+ int iconIdx = 0;
627623 if (data->node == svn_node_dir)
628- icon_idx = m_nIconFolder;
624+ iconIdx = m_nIconFolder;
629625 else
630626 {
631- icon_idx = SYS_IMAGE_LIST().GetPathIconIndex(data->path);
627+ iconIdx = SYS_IMAGE_LIST().GetPathIconIndex(data->path);
632628 }
633- pDispInfo->item.iImage = icon_idx;
629+ pDispInfo->item.iImage = iconIdx;
634630 }
635631 }
636632 }
@@ -639,7 +635,7 @@
639635
640636 void CFileDiffDlg::OnContextMenu(CWnd* pWnd, CPoint point)
641637 {
642- if ((pWnd==0)||(pWnd != &m_cFileList))
638+ if ((pWnd == nullptr) || (pWnd != &m_cFileList))
643639 return;
644640 if (m_cFileList.GetSelectedCount() == 0)
645641 return;
@@ -656,14 +652,13 @@
656652 if (!popup.CreatePopupMenu())
657653 return;
658654
659-
660- bool bHasPropChanges = false;
661- bool bHasTextChanges = false;
662- POSITION spos = m_cFileList.GetFirstSelectedItemPosition();
655+ bool bHasPropChanges = false;
656+ bool bHasTextChanges = false;
657+ POSITION spos = m_cFileList.GetFirstSelectedItemPosition();
663658 while (spos)
664659 {
665- int sindex = m_cFileList.GetNextSelectedItem(spos);
666- FileDiff sfd = m_arFilteredList[sindex];
660+ int sIndex = m_cFileList.GetNextSelectedItem(spos);
661+ FileDiff sfd = m_arFilteredList[sIndex];
667662 bHasTextChanges = bHasTextChanges || (sfd.kind != svn_client_diff_summarize_kind_normal);
668663 bHasPropChanges = bHasPropChanges || sfd.propchanged;
669664 }
@@ -692,11 +687,11 @@
692687 popup.AppendMenuIcon(ID_SAVEAS, IDS_FILEDIFF_POPSAVELIST, IDI_SAVEAS);
693688 popup.AppendMenuIcon(ID_CLIPBOARD, IDS_FILEDIFF_POPCLIPBOARD, IDI_COPYCLIP);
694689 popup.AppendMenuIcon(ID_EXPORT, IDS_FILEDIFF_POPEXPORT, IDI_EXPORT);
695- int cmd = popup.TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RIGHTBUTTON, point.x, point.y, this, 0);
690+ int cmd = popup.TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RIGHTBUTTON, point.x, point.y, this, nullptr);
696691 m_bCancelled = false;
697692 switch (cmd)
698693 {
699- case ID_COMPARE:
694+ case ID_COMPARE:
700695 {
701696 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
702697 while (pos)
@@ -703,9 +698,8 @@
703698 {
704699 int index = m_cFileList.GetNextSelectedItem(pos);
705700
706- auto f = [=]()
707- {
708- CoInitialize(NULL);
701+ auto f = [=]() {
702+ CoInitialize(nullptr);
709703 this->EnableWindow(FALSE);
710704
711705 DoDiff(index, true, true, false, false);
@@ -717,19 +711,18 @@
717711 }
718712 }
719713 break;
720- case ID_COMPARETEXT:
714+ case ID_COMPARETEXT:
721715 {
722716 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
723717 while (pos)
724718 {
725- int index = m_cFileList.GetNextSelectedItem(pos);
726- FileDiff sfd = m_arFilteredList[index];
719+ int index = m_cFileList.GetNextSelectedItem(pos);
720+ FileDiff sfd = m_arFilteredList[index];
727721 if (sfd.kind == svn_client_diff_summarize_kind_normal)
728722 continue;
729723
730- auto f = [=]()
731- {
732- CoInitialize(NULL);
724+ auto f = [=]() {
725+ CoInitialize(nullptr);
733726 this->EnableWindow(FALSE);
734727
735728 DoDiff(index, true, false, false, false);
@@ -741,19 +734,18 @@
741734 }
742735 }
743736 break;
744- case ID_COMPAREPROP:
737+ case ID_COMPAREPROP:
745738 {
746739 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
747740 while (pos)
748741 {
749- int index = m_cFileList.GetNextSelectedItem(pos);
750- FileDiff sfd = m_arFilteredList[index];
742+ int index = m_cFileList.GetNextSelectedItem(pos);
743+ FileDiff sfd = m_arFilteredList[index];
751744 if (!sfd.propchanged)
752745 continue;
753746
754- auto f = [=]()
755- {
756- CoInitialize(NULL);
747+ auto f = [=]() {
748+ CoInitialize(nullptr);
757749 this->EnableWindow(FALSE);
758750
759751 DoDiff(index, false, true, false, false);
@@ -765,9 +757,9 @@
765757 }
766758 }
767759 break;
768- case ID_UNIFIEDDIFF:
760+ case ID_UNIFIEDDIFF:
769761 {
770- bool prettyprint = true;
762+ bool prettyprint = true;
771763 CString options;
772764 if (GetAsyncKeyState(VK_SHIFT) & 0x8000)
773765 {
@@ -774,7 +766,7 @@
774766 CDiffOptionsDlg dlg(this);
775767 if (dlg.DoModal() == IDOK)
776768 {
777- options = dlg.GetDiffOptionsString();
769+ options = dlg.GetDiffOptionsString();
778770 prettyprint = dlg.GetPrettyPrint();
779771 }
780772 else
@@ -782,11 +774,10 @@
782774 }
783775 CTSVNPathList urls1, urls2;
784776 GetSelectedPaths(urls1, urls2);
785- CTSVNPath diffFile = CTempFiles::Instance().GetTempFilePath(false);
786- bool bDoPegDiff = m_bDoPegDiff;
787- auto f = [=]()
788- {
789- CoInitialize(NULL);
777+ CTSVNPath diffFile = CTempFiles::Instance().GetTempFilePath(false);
778+ bool bDoPegDiff = m_bDoPegDiff;
779+ auto f = [=]() {
780+ CoInitialize(nullptr);
790781 this->EnableWindow(FALSE);
791782
792783 CProgressDlg progDlg;
@@ -800,8 +791,8 @@
800791 {
801792 CTSVNPath url1 = urls1[i];
802793 CTSVNPath url2 = urls2[i];
803- progDlg.SetLine(3, (LPCTSTR)url1.GetUIFileOrDirectoryName(), true);
804- progDlg.SetProgress(i+1, urls1.GetCount());
794+ progDlg.SetLine(3, static_cast<LPCWSTR>(url1.GetUIFileOrDirectoryName()), true);
795+ progDlg.SetProgress(i + 1, urls1.GetCount());
805796 if (bDoPegDiff)
806797 {
807798 PegDiff(url1, m_peg, m_rev1, m_rev2, CTSVNPath(), m_depth, m_bIgnoreancestry, false, false, true, true, false, true, false, prettyprint, options, true, diffFile);
@@ -814,7 +805,7 @@
814805 break;
815806 }
816807 progDlg.Stop();
817- SetAndClearProgressInfo((HWND)NULL);
808+ SetAndClearProgressInfo(static_cast<HWND>(nullptr));
818809 CAppUtils::StartUnifiedDiffViewer(diffFile.GetWinPathString(), CString(), false);
819810
820811 this->EnableWindow(TRUE);
@@ -821,18 +812,16 @@
821812 this->SetFocus();
822813 };
823814 new async::CAsyncCall(f, &netScheduler);
824-
825815 }
826816 break;
827- case ID_BLAME:
817+ case ID_BLAME:
828818 {
829819 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
830820 while (pos)
831821 {
832- int index = m_cFileList.GetNextSelectedItem(pos);
833- auto f = [=]()
834- {
835- CoInitialize(NULL);
822+ int index = m_cFileList.GetNextSelectedItem(pos);
823+ auto f = [=]() {
824+ CoInitialize(nullptr);
836825 this->EnableWindow(FALSE);
837826
838827 DoDiff(index, true, false, true, false);
@@ -844,58 +833,58 @@
844833 }
845834 }
846835 break;
847- case ID_LOG:
836+ case ID_LOG:
848837 {
849- POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
850- int index = m_cFileList.GetNextSelectedItem(pos);
851- CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
852- CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
853- CString sCmd;
854- SVNRev rmax = max((LONG)m_rev1, (LONG)m_rev2);
838+ POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
839+ int index = m_cFileList.GetNextSelectedItem(pos);
840+ CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
841+ CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
842+ CString sCmd;
843+ SVNRev rmax = max(static_cast<LONG>(m_rev1), static_cast<LONG>(m_rev2));
855844 sCmd.Format(L"/command:log /path:\"%s\" /startrev:%s /pegrev:%s",
856- (LPCTSTR)url1.GetSVNPathString(), (LPCTSTR)rmax.ToString(), (LPCTSTR)m_peg.ToString());
845+ static_cast<LPCWSTR>(url1.GetSVNPathString()), static_cast<LPCWSTR>(rmax.ToString()), static_cast<LPCWSTR>(m_peg.ToString()));
857846 CAppUtils::RunTortoiseProc(sCmd);
858847 }
859848 break;
860- case ID_SAVEAS:
861- if (m_cFileList.GetSelectedCount() > 0)
862- {
863- CTSVNPath savePath;
864- CString pathSave;
865- if (!CAppUtils::FileOpenSave(pathSave, NULL, IDS_REPOBROWSE_SAVEAS, IDS_COMMONFILEFILTER, false, m_path1.IsUrl() ? CString() : m_path1.GetDirectory().GetWinPathString(), m_hWnd))
849+ case ID_SAVEAS:
850+ if (m_cFileList.GetSelectedCount() > 0)
866851 {
867- break;
868- }
869- savePath = CTSVNPath(pathSave);
852+ CTSVNPath savePath;
853+ CString pathSave;
854+ if (!CAppUtils::FileOpenSave(pathSave, nullptr, IDS_REPOBROWSE_SAVEAS, IDS_COMMONFILEFILTER, false, m_path1.IsUrl() ? CString() : m_path1.GetDirectory().GetWinPathString(), m_hWnd))
855+ {
856+ break;
857+ }
858+ savePath = CTSVNPath(pathSave);
870859
871- // now open the selected file for writing
872- try
873- {
874- CStdioFile file(savePath.GetWinPathString(), CFile::typeBinary | CFile::modeReadWrite | CFile::modeCreate);
875- CString temp;
876- temp.FormatMessage(IDS_FILEDIFF_CHANGEDLISTINTRO, (LPCTSTR)m_path1.GetSVNPathString(), (LPCTSTR)m_rev1.ToString(), (LPCTSTR)m_path2.GetSVNPathString(), (LPCTSTR)m_rev2.ToString());
877- file.WriteString(temp + L"\n");
878- POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
879- while (pos)
860+ // now open the selected file for writing
861+ try
880862 {
881- int index = m_cFileList.GetNextSelectedItem(pos);
882- FileDiff fd = m_arFilteredList[index];
883- file.WriteString(fd.path.GetSVNPathString());
884- file.WriteString(L"\n");
863+ CStdioFile file(savePath.GetWinPathString(), CFile::typeBinary | CFile::modeReadWrite | CFile::modeCreate);
864+ CString temp;
865+ temp.FormatMessage(IDS_FILEDIFF_CHANGEDLISTINTRO, static_cast<LPCWSTR>(m_path1.GetSVNPathString()), static_cast<LPCWSTR>(m_rev1.ToString()), static_cast<LPCWSTR>(m_path2.GetSVNPathString()), static_cast<LPCWSTR>(m_rev2.ToString()));
866+ file.WriteString(temp + L"\n");
867+ POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
868+ while (pos)
869+ {
870+ int index = m_cFileList.GetNextSelectedItem(pos);
871+ FileDiff fd = m_arFilteredList[index];
872+ file.WriteString(fd.path.GetSVNPathString());
873+ file.WriteString(L"\n");
874+ }
875+ file.Close();
885876 }
886- file.Close();
877+ catch (CFileException* pE)
878+ {
879+ pE->ReportError();
880+ pE->Delete();
881+ }
887882 }
888- catch (CFileException* pE)
889- {
890- pE->ReportError();
891- pE->Delete();
892- }
893- }
894- break;
895- case ID_CLIPBOARD:
896- CopySelectionToClipboard();
897- break;
898- case ID_EXPORT:
883+ break;
884+ case ID_CLIPBOARD:
885+ CopySelectionToClipboard();
886+ break;
887+ case ID_EXPORT:
899888 {
900889 // export all changed files to a folder
901890 CBrowseFolder browseFolder;
@@ -906,8 +895,8 @@
906895 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
907896 while (pos)
908897 {
909- int index = m_cFileList.GetNextSelectedItem(pos);
910- CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
898+ int index = m_cFileList.GetNextSelectedItem(pos);
899+ CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
911900 m_arSelectedFileList.Add(fd);
912901 }
913902 m_pProgDlg = new CProgressDlg();
@@ -927,32 +916,32 @@
927916
928917 UINT CFileDiffDlg::ExportThreadEntry(LPVOID pVoid)
929918 {
930- CCrashReportThread crashthread;
931- return ((CFileDiffDlg*)pVoid)->ExportThread();
919+ CCrashReportThread crashThread;
920+ return static_cast<CFileDiffDlg*>(pVoid)->ExportThread();
932921 }
933922
934923 UINT CFileDiffDlg::ExportThread()
935924 {
936925 RefreshCursor();
937- if (m_pProgDlg == NULL)
926+ if (m_pProgDlg == nullptr)
938927 return 1;
939928 long count = 0;
940929 SetAndClearProgressInfo(m_pProgDlg, false);
941930 m_pProgDlg->SetTitle(IDS_PROGRESSWAIT);
942931 m_pProgDlg->ShowModeless(this);
943- for (INT_PTR i=0; (i<m_arSelectedFileList.GetCount())&&(!m_pProgDlg->HasUserCancelled()); ++i)
932+ for (INT_PTR i = 0; (i < m_arSelectedFileList.GetCount()) && (!m_pProgDlg->HasUserCancelled()); ++i)
944933 {
945- CFileDiffDlg::FileDiff fd = m_arSelectedFileList[i];
946- CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
947- CTSVNPath url2 = m_bDoPegDiff ? url1 : CTSVNPath(m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
948- if ((fd.node == svn_node_dir)&&(fd.kind != svn_client_diff_summarize_kind_added))
934+ CFileDiffDlg::FileDiff fd = m_arSelectedFileList[i];
935+ CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
936+ CTSVNPath url2 = m_bDoPegDiff ? url1 : CTSVNPath(m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
937+ if ((fd.node == svn_node_dir) && (fd.kind != svn_client_diff_summarize_kind_added))
949938 {
950939 // just create the directory
951- CreateDirectoryEx(NULL, m_strExportDir+L"\\"+CPathUtils::PathUnescape(fd.path.GetWinPathString()), NULL);
940+ CreateDirectoryEx(nullptr, m_strExportDir + L"\\" + CPathUtils::PathUnescape(fd.path.GetWinPathString()), nullptr);
952941 continue;
953942 }
954943
955- m_pProgDlg->FormatPathLine(1, IDS_PROGRESSGETFILE, (LPCTSTR)url1.GetSVNPathString());
944+ m_pProgDlg->FormatPathLine(1, IDS_PROGRESSGETFILE, static_cast<LPCWSTR>(url1.GetSVNPathString()));
956945
957946 CTSVNPath savepath = CTSVNPath(m_strExportDir);
958947 savepath.AppendPathString(L"\\" + CPathUtils::PathUnescape(fd.path.GetWinPathString()));
@@ -961,13 +950,13 @@
961950 {
962951 // exporting a folder requires calling SVN::Export() so we also export all
963952 // children of that added folder.
964- if ((fd.kind == svn_client_diff_summarize_kind_added)&&(!Export(url2, savepath, m_bDoPegDiff ? m_peg : m_rev2, m_rev2, true, true)))
953+ if ((fd.kind == svn_client_diff_summarize_kind_added) && (!Export(url2, savepath, m_bDoPegDiff ? m_peg : m_rev2, m_rev2, true, true)))
965954 {
966- if ((!m_bDoPegDiff)||(!Export(url2, savepath, m_rev2, m_rev2, true, true)))
955+ if ((!m_bDoPegDiff) || (!Export(url2, savepath, m_rev2, m_rev2, true, true)))
967956 {
968- SetAndClearProgressInfo(NULL, false);
957+ SetAndClearProgressInfo(nullptr, false);
969958 delete m_pProgDlg;
970- m_pProgDlg = NULL;
959+ m_pProgDlg = nullptr;
971960 ShowErrorDialog(m_hWnd);
972961 InterlockedExchange(&m_bThreadRunning, FALSE);
973962 RefreshCursor();
@@ -977,13 +966,13 @@
977966 }
978967 else
979968 {
980- if ((fd.kind != svn_client_diff_summarize_kind_deleted)&&(!Export(url2, savepath, m_bDoPegDiff ? m_peg : m_rev2, m_rev2)))
969+ if ((fd.kind != svn_client_diff_summarize_kind_deleted) && (!Export(url2, savepath, m_bDoPegDiff ? m_peg : m_rev2, m_rev2)))
981970 {
982- if ((!m_bDoPegDiff)||(!Export(url2, savepath, m_rev2, m_rev2)))
971+ if ((!m_bDoPegDiff) || (!Export(url2, savepath, m_rev2, m_rev2)))
983972 {
984- SetAndClearProgressInfo(NULL, false);
973+ SetAndClearProgressInfo(nullptr, false);
985974 delete m_pProgDlg;
986- m_pProgDlg = NULL;
975+ m_pProgDlg = nullptr;
987976 ShowErrorDialog(m_hWnd);
988977 InterlockedExchange(&m_bThreadRunning, FALSE);
989978 RefreshCursor();
@@ -992,12 +981,12 @@
992981 }
993982 }
994983 count++;
995- m_pProgDlg->SetProgress (count, static_cast<DWORD>(m_arSelectedFileList.GetCount()));
984+ m_pProgDlg->SetProgress(count, static_cast<DWORD>(m_arSelectedFileList.GetCount()));
996985 }
997986 m_pProgDlg->Stop();
998- SetAndClearProgressInfo(NULL, false);
987+ SetAndClearProgressInfo(nullptr, false);
999988 delete m_pProgDlg;
1000- m_pProgDlg = NULL;
989+ m_pProgDlg = nullptr;
1001990 InterlockedExchange(&m_bThreadRunning, FALSE);
1002991 RefreshCursor();
1003992 return 0;
@@ -1007,28 +996,29 @@
1007996 {
1008997 if (pWnd != &m_cFileList && this->IsWindowEnabled())
1009998 return CResizableStandAloneDialog::OnSetCursor(pWnd, nHitTest, message);
1010- if ((m_bThreadRunning == 0 && netScheduler.GetRunningThreadCount() == 0)||(IsCursorOverWindowBorder()))
999+ if ((m_bThreadRunning == 0 && netScheduler.GetRunningThreadCount() == 0) || (IsCursorOverWindowBorder()))
10111000 {
1012- HCURSOR hCur = LoadCursor(NULL, IDC_ARROW);
1001+ HCURSOR hCur = LoadCursor(nullptr, IDC_ARROW);
10131002 SetCursor(hCur);
10141003 return CResizableStandAloneDialog::OnSetCursor(pWnd, nHitTest, message);
10151004 }
1016- HCURSOR hCur = LoadCursor(NULL, IDC_WAIT);
1005+ HCURSOR hCur = LoadCursor(nullptr, IDC_WAIT);
10171006 SetCursor(hCur);
10181007 return TRUE;
10191008 }
10201009
1010+// ReSharper disable once CppMemberFunctionMayBeConst
10211011 void CFileDiffDlg::OnEnSetfocusFirsturl()
10221012 {
10231013 GetDlgItem(IDC_FIRSTURL)->HideCaret();
10241014 }
10251015
1016+// ReSharper disable once CppMemberFunctionMayBeConst
10261017 void CFileDiffDlg::OnEnSetfocusSecondurl()
10271018 {
10281019 GetDlgItem(IDC_SECONDURL)->HideCaret();
10291020 }
10301021
1031-
10321022 void CFileDiffDlg::OnBnClickedSwitchleftright()
10331023 {
10341024 if (m_bThreadRunning)
@@ -1038,7 +1028,7 @@
10381028
10391029 m_cFileList.SetRedraw(false);
10401030 m_cFileList.DeleteAllItems();
1041- for (int i=0; i<(int)m_arFileList.size(); ++i)
1031+ for (int i = 0; i < static_cast<int>(m_arFileList.size()); ++i)
10421032 {
10431033 FileDiff fd = m_arFileList[i];
10441034 if (fd.kind == svn_client_diff_summarize_kind_added)
@@ -1051,11 +1041,11 @@
10511041
10521042 m_cFileList.SetRedraw(true);
10531043 CTSVNPath path = m_path1;
1054- m_path1 = m_path2;
1055- m_path2 = path;
1056- SVNRev rev = m_rev1;
1057- m_rev1 = m_rev2;
1058- m_rev2 = rev;
1044+ m_path1 = m_path2;
1045+ m_path2 = path;
1046+ SVNRev rev = m_rev1;
1047+ m_rev1 = m_rev2;
1048+ m_rev2 = rev;
10591049 SetURLLabels();
10601050 }
10611051
@@ -1076,12 +1066,12 @@
10761066 {
10771067 switch (pMsg->wParam)
10781068 {
1079- case 'A':
1069+ case 'A':
10801070 {
1081- if (GetAsyncKeyState(VK_CONTROL)&0x8000)
1071+ if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
10821072 {
10831073 // select all entries
1084- for (int i=0; i<m_cFileList.GetItemCount(); ++i)
1074+ for (int i = 0; i < m_cFileList.GetItemCount(); ++i)
10851075 {
10861076 m_cFileList.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
10871077 }
@@ -1089,12 +1079,12 @@
10891079 }
10901080 }
10911081 break;
1092- case 'C':
1093- case VK_INSERT:
1082+ case 'C':
1083+ case VK_INSERT:
10941084 {
10951085 if (GetFocus() == &m_cFileList)
10961086 {
1097- if (GetAsyncKeyState(VK_CONTROL)&0x8000)
1087+ if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
10981088 {
10991089 CopySelectionToClipboard();
11001090 return TRUE;
@@ -1102,23 +1092,23 @@
11021092 }
11031093 }
11041094 break;
1105- case VK_RETURN:
1095+ case VK_RETURN:
11061096 {
11071097 if (GetFocus() == GetDlgItem(IDC_FILELIST))
11081098 {
11091099 // Return pressed in file list. Show diff, as for double click
11101100 int selIndex = m_cFileList.GetSelectionMark();
1111- if ((selIndex >= 0) && (selIndex < (int)m_arFileList.size()))
1101+ if ((selIndex >= 0) && (selIndex < static_cast<int>(m_arFileList.size())))
11121102 DoDiff(selIndex, true, false, m_bBlame, true);
11131103 return TRUE;
11141104 }
11151105 }
11161106 break;
1117- case VK_F5:
1107+ case VK_F5:
11181108 {
11191109 if (!InterlockedExchange(&m_bThreadRunning, TRUE))
11201110 {
1121- if (AfxBeginThread(DiffThreadEntry, this)==NULL)
1111+ if (AfxBeginThread(DiffThreadEntry, this) == nullptr)
11221112 {
11231113 InterlockedExchange(&m_bThreadRunning, FALSE);
11241114 OnCantStartThread();
@@ -1144,7 +1134,7 @@
11441134 __super::OnCancel();
11451135 }
11461136
1147-void CFileDiffDlg::OnHdnItemclickFilelist(NMHDR *pNMHDR, LRESULT *pResult)
1137+void CFileDiffDlg::OnHdnItemclickFilelist(NMHDR* pNMHDR, LRESULT* pResult)
11481138 {
11491139 LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
11501140 if (m_bThreadRunning)
@@ -1164,18 +1154,18 @@
11641154 m_cFilter.GetWindowText(temp);
11651155 Filter(temp);
11661156
1167- CHeaderCtrl * pHeader = m_cFileList.GetHeaderCtrl();
1168- HDITEM HeaderItem = {0};
1169- HeaderItem.mask = HDI_FORMAT;
1170- for (int i=0; i<pHeader->GetItemCount(); ++i)
1157+ CHeaderCtrl* pHeader = m_cFileList.GetHeaderCtrl();
1158+ HDITEM headerItem = {0};
1159+ headerItem.mask = HDI_FORMAT;
1160+ for (int i = 0; i < pHeader->GetItemCount(); ++i)
11711161 {
1172- pHeader->GetItem(i, &HeaderItem);
1173- HeaderItem.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1174- pHeader->SetItem(i, &HeaderItem);
1162+ pHeader->GetItem(i, &headerItem);
1163+ headerItem.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1164+ pHeader->SetItem(i, &headerItem);
11751165 }
1176- pHeader->GetItem(m_nSortedColumn, &HeaderItem);
1177- HeaderItem.fmt |= (m_bAscending ? HDF_SORTUP : HDF_SORTDOWN);
1178- pHeader->SetItem(m_nSortedColumn, &HeaderItem);
1166+ pHeader->GetItem(m_nSortedColumn, &headerItem);
1167+ headerItem.fmt |= (m_bAscending ? HDF_SORTUP : HDF_SORTDOWN);
1168+ pHeader->SetItem(m_nSortedColumn, &headerItem);
11791169
11801170 m_cFileList.SetRedraw(TRUE);
11811171
@@ -1184,7 +1174,7 @@
11841174
11851175 void CFileDiffDlg::Sort()
11861176 {
1187- if(m_arFileList.size() < 2)
1177+ if (m_arFileList.size() < 2)
11881178 {
11891179 return;
11901180 }
@@ -1192,22 +1182,22 @@
11921182 std::sort(m_arFileList.begin(), m_arFileList.end(), &CFileDiffDlg::SortCompare);
11931183 }
11941184
1195-bool CFileDiffDlg::SortCompare(const FileDiff& Data1, const FileDiff& Data2)
1185+bool CFileDiffDlg::SortCompare(const FileDiff& data1, const FileDiff& data2)
11961186 {
11971187 int result = 0;
11981188 switch (m_nSortedColumn)
11991189 {
1200- case 0: //path column
1201- if (s_bSortLogical)
1202- result = StrCmpLogicalW(Data1.path.GetWinPathString(), Data2.path.GetWinPathString());
1203- else
1204- result = StrCmpI(Data1.path.GetWinPathString(), Data2.path.GetWinPathString());
1205- break;
1206- case 1: //action column
1207- result = Data1.kind - Data2.kind;
1208- break;
1209- default:
1210- break;
1190+ case 0: //path column
1191+ if (s_bSortLogical)
1192+ result = StrCmpLogicalW(data1.path.GetWinPathString(), data2.path.GetWinPathString());
1193+ else
1194+ result = StrCmpI(data1.path.GetWinPathString(), data2.path.GetWinPathString());
1195+ break;
1196+ case 1: //action column
1197+ result = data1.kind - data2.kind;
1198+ break;
1199+ default:
1200+ break;
12111201 }
12121202
12131203 if (!m_bAscending)
@@ -1224,11 +1214,11 @@
12241214 CRevisionDlg dlg(this);
12251215 dlg.AllowWCRevs(false);
12261216 dlg.SetLogPath(m_path1, m_rev1);
1227- *((SVNRev*)&dlg) = m_rev1;
1217+ *static_cast<SVNRev*>(&dlg) = m_rev1;
12281218
12291219 if (dlg.DoModal() == IDOK)
12301220 {
1231- m_rev1 = dlg;
1221+ m_rev1 = static_cast<SVNRev>(dlg);
12321222 m_cRev1Btn.SetWindowText(m_rev1.ToString());
12331223 m_cFileList.DeleteAllItems();
12341224 // start a new thread to re-fetch the diff
@@ -1252,11 +1242,11 @@
12521242 CRevisionDlg dlg(this);
12531243 dlg.AllowWCRevs(false);
12541244 dlg.SetLogPath(m_path2, m_rev2);
1255- *((SVNRev*)&dlg) = m_rev2;
1245+ *static_cast<SVNRev*>(&dlg) = m_rev2;
12561246
12571247 if (dlg.DoModal() == IDOK)
12581248 {
1259- m_rev2 = dlg;
1249+ m_rev2 = static_cast<SVNRev>(dlg);
12601250 m_cRev2Btn.SetWindowText(m_rev2.ToString());
12611251 m_cFileList.DeleteAllItems();
12621252 // start a new thread to re-fetch the diff
@@ -1275,7 +1265,7 @@
12751265 {
12761266 if (m_bThreadRunning)
12771267 {
1278- SetTimer(IDT_FILTER, 1000, NULL);
1268+ SetTimer(IDT_FILTER, 1000, nullptr);
12791269 return 0L;
12801270 }
12811271
@@ -1293,7 +1283,7 @@
12931283
12941284 void CFileDiffDlg::OnEnChangeFilter()
12951285 {
1296- SetTimer(IDT_FILTER, 1000, NULL);
1286+ SetTimer(IDT_FILTER, 1000, nullptr);
12971287 }
12981288
12991289 void CFileDiffDlg::OnTimer(UINT_PTR nIDEvent)
@@ -1322,7 +1312,7 @@
13221312 std::vector<CString> positives;
13231313 std::vector<CString> negatives;
13241314
1325- int pos = 0;
1315+ int pos = 0;
13261316 CString temp;
13271317 for (;;)
13281318 {
@@ -1369,15 +1359,15 @@
13691359 }
13701360 }
13711361 }
1372- m_cFileList.SetItemCount((int)m_arFilteredList.size());
1362+ m_cFileList.SetItemCount(static_cast<int>(m_arFilteredList.size()));
13731363 }
13741364
1375-void CFileDiffDlg::CopySelectionToClipboard()
1365+void CFileDiffDlg::CopySelectionToClipboard() const
13761366 {
13771367 // copy all selected paths to the clipboard
13781368 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
1379- int index;
1380- CString sTextForClipboard;
1369+ int index;
1370+ CString sTextForClipboard;
13811371 while ((index = m_cFileList.GetNextSelectedItem(pos)) >= 0)
13821372 {
13831373 sTextForClipboard += m_cFileList.GetItemText(index, 0);
@@ -1393,9 +1383,9 @@
13931383 POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
13941384 while (pos)
13951385 {
1396- int index = m_cFileList.GetNextSelectedItem(pos);
1397- CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
1398- CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
1386+ int index = m_cFileList.GetNextSelectedItem(pos);
1387+ CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
1388+ CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
13991389 urls1.AddPath(url1);
14001390 CTSVNPath url2 = m_bDoPegDiff ? url1 : CTSVNPath(m_path2.GetSVNPathString() + L"/" + fd.path.GetSVNPathString());
14011391 urls2.AddPath(url2);
--- trunk/src/TortoiseProc/FileDiffDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/FileDiffDlg.h (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2016, 2020 - TortoiseSVN
3+// Copyright (C) 2003-2016, 2020-2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -22,7 +22,6 @@
2222 #include "SVN.h"
2323 #include "TSVNPath.h"
2424 #include "Blame.h"
25-#include "SVN.h"
2625 #include "HintCtrl.h"
2726 #include "Colors.h"
2827 #include "FilterEdit.h"
@@ -29,7 +28,7 @@
2928 #include "JobScheduler.h"
3029 #include "ThemeControls.h"
3130
32-#define IDT_FILTER 101
31+#define IDT_FILTER 101
3332
3433 /**
3534 * \ingroup TortoiseProc
@@ -37,7 +36,8 @@
3736 * repository. It shows a list of files/folders which were changed in those
3837 * two revisions.
3938 */
40-class CFileDiffDlg : public CResizableStandAloneDialog, public SVN
39+class CFileDiffDlg : public CResizableStandAloneDialog
40+ , public SVN
4141 {
4242 DECLARE_DYNAMIC(CFileDiffDlg)
4343 public:
@@ -44,100 +44,105 @@
4444 class FileDiff
4545 {
4646 public:
47- CTSVNPath path;
47+ CTSVNPath path;
4848 svn_client_diff_summarize_kind_t kind;
49- bool propchanged;
50- svn_node_kind_t node;
49+ bool propchanged;
50+ svn_node_kind_t node;
5151 };
52+
5253 public:
53- CFileDiffDlg(CWnd* pParent = NULL);
54- virtual ~CFileDiffDlg();
54+ CFileDiffDlg(CWnd* pParent = nullptr);
55+ ~CFileDiffDlg() override;
5556
5657 void SetDiff(const CTSVNPath& path1, const SVNRev& rev1, const CTSVNPath& path2, const SVNRev& rev2, svn_depth_t depth, bool ignoreancestry);
5758 void SetDiff(const CTSVNPath& path, const SVNRev& peg, const SVNRev& rev1, const SVNRev& rev2, svn_depth_t depth, bool ignoreancestry);
5859
59- void DoBlame(bool blame = true) {m_bBlame = blame;}
60+ void DoBlame(bool blame = true) { m_bBlame = blame; }
6061
61- enum { IDD = IDD_DIFFFILES };
62+ enum
63+ {
64+ IDD = IDD_DIFFFILES
65+ };
6266
6367 protected:
64- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
65- virtual void OnCancel();
66- virtual BOOL OnInitDialog();
67- virtual BOOL PreTranslateMessage(MSG* pMsg);
68- afx_msg void OnNMDblclkFilelist(NMHDR *pNMHDR, LRESULT *pResult);
69- afx_msg void OnLvnGetInfoTipFilelist(NMHDR *pNMHDR, LRESULT *pResult);
70- afx_msg void OnNMCustomdrawFilelist(NMHDR *pNMHDR, LRESULT *pResult);
71- afx_msg void OnLvnGetdispinfoFilelist(NMHDR *pNMHDR, LRESULT *pResult);
72- afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
73- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
74- afx_msg void OnEnSetfocusSecondurl();
75- afx_msg void OnEnSetfocusFirsturl();
76- afx_msg void OnBnClickedSwitchleftright();
77- afx_msg void OnHdnItemclickFilelist(NMHDR *pNMHDR, LRESULT *pResult);
78- afx_msg void OnBnClickedRev1btn();
79- afx_msg void OnBnClickedRev2btn();
68+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
69+ void OnCancel() override;
70+ BOOL OnInitDialog() override;
71+ BOOL PreTranslateMessage(MSG* pMsg) override;
72+ afx_msg void OnNMDblclkFilelist(NMHDR* pNMHDR, LRESULT* pResult);
73+ afx_msg void OnLvnGetInfoTipFilelist(NMHDR* pNMHDR, LRESULT* pResult);
74+ afx_msg void OnNMCustomdrawFilelist(NMHDR* pNMHDR, LRESULT* pResult);
75+ afx_msg void OnLvnGetdispinfoFilelist(NMHDR* pNMHDR, LRESULT* pResult);
76+ afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
77+ afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
78+ afx_msg void OnEnSetfocusSecondurl();
79+ afx_msg void OnEnSetfocusFirsturl();
80+ afx_msg void OnBnClickedSwitchleftright();
81+ afx_msg void OnHdnItemclickFilelist(NMHDR* pNMHDR, LRESULT* pResult);
82+ afx_msg void OnBnClickedRev1btn();
83+ afx_msg void OnBnClickedRev2btn();
8084 afx_msg LRESULT OnClickedCancelFilter(WPARAM wParam, LPARAM lParam);
81- afx_msg void OnEnChangeFilter();
82- afx_msg void OnTimer(UINT_PTR nIDEvent);
83- afx_msg void OnSetFocus(CWnd* pOldWnd);
85+ afx_msg void OnEnChangeFilter();
86+ afx_msg void OnTimer(UINT_PTR nIDEvent);
87+ afx_msg void OnSetFocus(CWnd* pOldWnd);
8488
8589 DECLARE_MESSAGE_MAP()
8690
87- virtual svn_error_t* DiffSummarizeCallback(const CTSVNPath& path,
88- svn_client_diff_summarize_kind_t kind,
89- bool propchanged,
90- svn_node_kind_t node) override;
91+ svn_error_t* DiffSummarizeCallback(const CTSVNPath& path,
92+ svn_client_diff_summarize_kind_t kind,
93+ bool propchanged,
94+ svn_node_kind_t node) override;
9195
92- void DoDiff(int selIndex, bool bText, bool bProps, bool blame, bool bDefault);
93- void DiffProps(int selIndex);
94- void SetURLLabels();
95- void Filter(CString sFilterText);
96- void CopySelectionToClipboard();
96+ void DoDiff(int selIndex, bool bText, bool bProps, bool blame, bool bDefault);
97+ void DiffProps(int selIndex);
98+ void SetURLLabels();
99+ void Filter(CString sFilterText);
100+ void CopySelectionToClipboard() const;
101+
97102 private:
98- static UINT DiffThreadEntry(LPVOID pVoid);
99- UINT DiffThread();
100- static UINT ExportThreadEntry(LPVOID pVoid);
101- UINT ExportThread();
102- void GetSelectedPaths(CTSVNPathList& urls1, CTSVNPathList& urls2);
103+ static UINT DiffThreadEntry(LPVOID pVoid);
104+ UINT DiffThread();
105+ static UINT ExportThreadEntry(LPVOID pVoid);
106+ UINT ExportThread();
107+ void GetSelectedPaths(CTSVNPathList& urls1, CTSVNPathList& urls2);
103108
104- virtual BOOL Cancel() override {return m_bCancelled;}
109+ BOOL Cancel() override { return m_bCancelled; }
105110
106- CButton m_cRev1Btn;
107- CButton m_cRev2Btn;
108- CFilterEdit m_cFilter;
111+ CButton m_cRev1Btn;
112+ CButton m_cRev2Btn;
113+ CFilterEdit m_cFilter;
109114
110- CThemeMFCButton m_SwitchButton;
111- CColors m_colors;
112- CHintCtrl<CListCtrl> m_cFileList;
113- TCHAR m_columnbuf[MAX_PATH];
114- bool m_bBlame;
115- CBlame m_blamer;
116- std::vector<FileDiff> m_arFileList;
117- std::vector<FileDiff> m_arFilteredList;
115+ CThemeMFCButton m_switchButton;
116+ CColors m_colors;
117+ CHintCtrl<CListCtrl> m_cFileList;
118+ TCHAR m_columnBuf[MAX_PATH];
119+ bool m_bBlame;
120+ CBlame m_blamer;
121+ std::vector<FileDiff> m_arFileList;
122+ std::vector<FileDiff> m_arFilteredList;
118123 CArray<FileDiff, FileDiff> m_arSelectedFileList;
119124
120- CString m_strExportDir;
121- CProgressDlg * m_pProgDlg;
125+ CString m_strExportDir;
126+ CProgressDlg* m_pProgDlg;
122127
123- int m_nIconFolder;
128+ int m_nIconFolder;
124129
125- CTSVNPath m_path1;
126- SVNRev m_peg;
127- SVNRev m_rev1;
128- CTSVNPath m_path2;
129- SVNRev m_rev2;
130- svn_depth_t m_depth;
131- bool m_bIgnoreancestry;
132- bool m_bDoPegDiff;
133- volatile LONG m_bThreadRunning;
130+ CTSVNPath m_path1;
131+ SVNRev m_peg;
132+ SVNRev m_rev1;
133+ CTSVNPath m_path2;
134+ SVNRev m_rev2;
135+ svn_depth_t m_depth;
136+ bool m_bIgnoreancestry;
137+ bool m_bDoPegDiff;
138+ volatile LONG m_bThreadRunning;
134139 async::CJobScheduler netScheduler;
135140
136- bool m_bCancelled;
141+ bool m_bCancelled;
137142
138- void Sort();
139- static bool SortCompare(const FileDiff& Data1, const FileDiff& Data2);
143+ void Sort();
144+ static bool SortCompare(const FileDiff& data1, const FileDiff& data2);
140145
141- static BOOL m_bAscending;
142- static int m_nSortedColumn;
146+ static BOOL m_bAscending;
147+ static int m_nSortedColumn;
143148 };
--- trunk/src/TortoiseProc/GoOffline.cpp (revision 29183)
+++ trunk/src/TortoiseProc/GoOffline.cpp (revision 29184)
@@ -1,11 +1,25 @@
1-// GoOffline.cpp : implementation file
1+// TortoiseSVN - a Windows shell extension for easy version control
2+
3+// Copyright (C) 2021 - TortoiseSVN
4+
5+// This program is free software; you can redistribute it and/or
6+// modify it under the terms of the GNU General Public License
7+// as published by the Free Software Foundation; either version 2
8+// of the License, or (at your option) any later version.
9+
10+// This program is distributed in the hope that it will be useful,
11+// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+// GNU General Public License for more details.
14+
15+// You should have received a copy of the GNU General Public License
16+// along with this program; if not, write to the Free Software Foundation,
17+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
218 //
319
420 #include "stdafx.h"
5-#include "TortoiseProc.h"
621 #include "GoOffline.h"
722
8-
923 // CGoOffline dialog
1024
1125 IMPLEMENT_DYNAMIC(CGoOffline, CDialog)
@@ -12,11 +26,10 @@
1226
1327 CGoOffline::CGoOffline(CWnd* pParent /*=NULL*/)
1428 : CDialog(CGoOffline::IDD, pParent)
29+ , selection(LogCache::online)
1530 , asDefault(false)
16- , selection(LogCache::online)
1731 , doRetry(false)
1832 {
19-
2033 }
2134
2235 CGoOffline::~CGoOffline()
@@ -35,7 +48,6 @@
3548 DDX_Check(pDX, IDC_ASDEFAULTOFFLINE, asDefault);
3649 }
3750
38-
3951 BEGIN_MESSAGE_MAP(CGoOffline, CDialog)
4052 ON_BN_CLICKED(IDOK, &CGoOffline::OnBnClickedOk)
4153 ON_BN_CLICKED(IDC_PERMANENTLYOFFLINE, &CGoOffline::OnBnClickedPermanentlyOffline)
@@ -43,7 +55,6 @@
4355 ON_BN_CLICKED(IDC_RETRY, &CGoOffline::OnBnClickedRetry)
4456 END_MESSAGE_MAP()
4557
46-
4758 BOOL CGoOffline::OnInitDialog()
4859 {
4960 CDialog::OnInitDialog();
@@ -76,10 +87,9 @@
7687 OnCancel();
7788 }
7889
79-
8090 void CGoOffline::OnBnClickedRetry()
8191 {
82- doRetry = true;
92+ doRetry = true;
8393 selection = LogCache::online;
8494
8595 OnCancel();
--- trunk/src/TortoiseProc/GoOffline.h (revision 29183)
+++ trunk/src/TortoiseProc/GoOffline.h (revision 29184)
@@ -1,5 +1,23 @@
1-#pragma once
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3+// Copyright (C) 2021 - TortoiseSVN
4+
5+// This program is free software; you can redistribute it and/or
6+// modify it under the terms of the GNU General Public License
7+// as published by the Free Software Foundation; either version 2
8+// of the License, or (at your option) any later version.
9+
10+// This program is distributed in the hope that it will be useful,
11+// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+// GNU General Public License for more details.
14+
15+// You should have received a copy of the GNU General Public License
16+// along with this program; if not, write to the Free Software Foundation,
17+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18+//
19+#pragma once
20+
321 #include "RepositoryInfo.h"
422
523 // CGoOffline dialog
@@ -9,21 +27,24 @@
927 DECLARE_DYNAMIC(CGoOffline)
1028
1129 public:
12- CGoOffline(CWnd* pParent = NULL); // standard constructor
13- virtual ~CGoOffline();
30+ CGoOffline(CWnd* pParent = nullptr); // standard constructor
31+ ~CGoOffline() override;
1432
1533 void SetErrorMessage(const CString& errMsg);
1634
1735 LogCache::ConnectionState selection;
18- BOOL asDefault;
19- BOOL doRetry;
36+ BOOL asDefault;
37+ BOOL doRetry;
2038
21-// Dialog Data
22- enum { IDD = IDD_GOOFFLINE };
39+ // Dialog Data
40+ enum
41+ {
42+ IDD = IDD_GOOFFLINE
43+ };
2344
2445 protected:
25- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
26- virtual BOOL OnInitDialog();
46+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
47+ BOOL OnInitDialog() override;
2748
2849 afx_msg void OnBnClickedOk();
2950 afx_msg void OnBnClickedPermanentlyOffline();
--- trunk/src/TortoiseProc/HistoryDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/HistoryDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2014, 2017 - TortoiseSVN
3+// Copyright (C) 2003-2014, 2017, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -18,15 +18,12 @@
1818 //
1919
2020 #include "stdafx.h"
21-#include "TortoiseProc.h"
22-#include "registry.h"
2321 #include "HistoryDlg.h"
2422
25-
2623 IMPLEMENT_DYNAMIC(CHistoryDlg, CResizableStandAloneDialog)
2724 CHistoryDlg::CHistoryDlg(CWnd* pParent /*=NULL*/)
2825 : CResizableStandAloneDialog(CHistoryDlg::IDD, pParent)
29- , m_history(NULL)
26+ , m_history(nullptr)
3027 {
3128 }
3229
@@ -37,11 +34,10 @@
3734 void CHistoryDlg::DoDataExchange(CDataExchange* pDX)
3835 {
3936 CResizableStandAloneDialog::DoDataExchange(pDX);
40- DDX_Control(pDX, IDC_HISTORYLIST, m_List);
37+ DDX_Control(pDX, IDC_HISTORYLIST, m_list);
4138 DDX_Control(pDX, IDC_SEARCHEDIT, m_cFilter);
4239 }
4340
44-
4541 BEGIN_MESSAGE_MAP(CHistoryDlg, CResizableStandAloneDialog)
4642 ON_BN_CLICKED(IDOK, OnBnClickedOk)
4743 ON_LBN_DBLCLK(IDC_HISTORYLIST, OnLbnDblclkHistorylist)
@@ -50,17 +46,16 @@
5046 ON_REGISTERED_MESSAGE(CFilterEdit::WM_FILTEREDIT_CANCELCLICKED, &CHistoryDlg::OnClickedCancelFilter)
5147 END_MESSAGE_MAP()
5248
53-
5449 void CHistoryDlg::OnBnClickedOk()
5550 {
56- int pos = m_List.GetCurSel();
51+ int pos = m_list.GetCurSel();
5752 if (pos != LB_ERR)
5853 {
59- int index = (int)m_List.GetItemData(pos);
60- m_SelectedText = m_history->GetEntry(index);
54+ int index = static_cast<int>(m_list.GetItemData(pos));
55+ m_selectedText = m_history->GetEntry(index);
6156 }
6257 else
63- m_SelectedText.Empty();
58+ m_selectedText.Empty();
6459 OnOK();
6560 }
6661
@@ -79,21 +74,21 @@
7974 AddAnchor(IDOK, BOTTOM_RIGHT);
8075 AddAnchor(IDCANCEL, BOTTOM_RIGHT);
8176 EnableSaveRestore(L"HistoryDlg");
82- m_List.SetFocus();
77+ m_list.SetFocus();
8378 return FALSE;
8479 }
8580
8681 void CHistoryDlg::OnLbnDblclkHistorylist()
8782 {
88- int pos = m_List.GetCurSel();
83+ int pos = m_list.GetCurSel();
8984 if (pos != LB_ERR)
9085 {
91- int index = (int)m_List.GetItemData(pos);
92- m_SelectedText = m_history->GetEntry(index);
86+ int index = static_cast<int>(m_list.GetItemData(pos));
87+ m_selectedText = m_history->GetEntry(index);
9388 OnOK();
9489 }
9590 else
96- m_SelectedText.Empty();
91+ m_selectedText.Empty();
9792 }
9893
9994 BOOL CHistoryDlg::PreTranslateMessage(MSG* pMsg)
@@ -100,20 +95,20 @@
10095 {
10196 if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_DELETE))
10297 {
103- int pos = m_List.GetCurSel();
98+ int pos = m_list.GetCurSel();
10499 if (pos != LB_ERR)
105100 {
106- int index = (int)m_List.GetItemData(pos);
107- m_List.DeleteString(pos);
108- m_List.SetCurSel(min(pos, m_List.GetCount() - 1));
101+ int index = static_cast<int>(m_list.GetItemData(pos));
102+ m_list.DeleteString(pos);
103+ m_list.SetCurSel(min(pos, m_list.GetCount() - 1));
109104 m_history->RemoveEntry(index);
110105 m_history->Save();
111106 // adjust the indexes
112- for (int i = 0; i < m_List.GetCount(); ++i)
107+ for (int i = 0; i < m_list.GetCount(); ++i)
113108 {
114- int ni = (int)m_List.GetItemData(i);
109+ int ni = static_cast<int>(m_list.GetItemData(i));
115110 if (ni > index)
116- m_List.SetItemData(i, ni - 1);
111+ m_list.SetItemData(i, ni - 1LL);
117112 }
118113 return TRUE;
119114 }
@@ -132,13 +127,12 @@
132127 CString sFilter;
133128 GetDlgItemText(IDC_SEARCHEDIT, sFilter);
134129 sFilter.MakeLower();
135- int pos = 0;
136- CString temp;
130+ int pos = 0;
137131 std::vector<CString> tokens;
138- for(;;)
132+ for (;;)
139133 {
140- temp = sFilter.Tokenize(L" ", pos);
141- if(temp.IsEmpty())
134+ CString temp = sFilter.Tokenize(L" ", pos);
135+ if (temp.IsEmpty())
142136 {
143137 break;
144138 }
@@ -145,15 +139,14 @@
145139 tokens.push_back(temp);
146140 }
147141
148- m_List.ResetContent();
142+ m_list.ResetContent();
149143
150144 // calculate and set listbox width
151- CDC* pDC=m_List.GetDC();
152- CSize itemExtent;
153- int horizExtent = 1;
145+ CDC* pDC = m_list.GetDC();
146+ int horizExtent = 1;
154147 for (size_t i = 0; i < m_history->GetCount(); ++i)
155148 {
156- CString sEntry = m_history->GetEntry(i);
149+ CString sEntry = m_history->GetEntry(i);
157150 CString sLowerEntry = sEntry;
158151 sLowerEntry.MakeLower();
159152 bool match = true;
@@ -169,17 +162,17 @@
169162 {
170163 sEntry.Remove('\r');
171164 sEntry.Replace('\n', ' ');
172- int index = m_List.AddString(sEntry);
173- m_List.SetItemData(index, i);
174- itemExtent = pDC->GetTextExtent(sEntry);
175- horizExtent = max(horizExtent, (int)itemExtent.cx + 5);
165+ int index = m_list.AddString(sEntry);
166+ m_list.SetItemData(index, i);
167+ CSize itemExtent = pDC->GetTextExtent(sEntry);
168+ horizExtent = max(horizExtent, static_cast<int>(itemExtent.cx) + 5);
176169 }
177170 }
178- m_List.SetHorizontalExtent(horizExtent);
171+ m_list.SetHorizontalExtent(horizExtent);
179172 ReleaseDC(pDC);
180173 }
181174
182-bool CHistoryDlg::Validate( LPCTSTR /*string*/ )
175+bool CHistoryDlg::Validate(LPCWSTR /*string*/)
183176 {
184177 return true;
185178 }
--- trunk/src/TortoiseProc/HistoryDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/HistoryDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2007, 2009-2010, 2013, 2017 - TortoiseSVN
3+// Copyright (C) 2003-2007, 2009-2010, 2013, 2017, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -26,25 +26,29 @@
2626 * \ingroup TortoiseProc
2727 * Dialog showing the log message history.
2828 */
29-class CHistoryDlg : public CResizableStandAloneDialog, IFilterEditValidator
29+class CHistoryDlg : public CResizableStandAloneDialog
30+ , IFilterEditValidator
3031 {
3132 DECLARE_DYNAMIC(CHistoryDlg)
3233 public:
33- CHistoryDlg(CWnd* pParent = NULL); // standard constructor
34- virtual ~CHistoryDlg();
34+ CHistoryDlg(CWnd* pParent = nullptr); // standard constructor
35+ ~CHistoryDlg() override;
3536
3637 /// Returns the text of the selected entry.
37- CString GetSelectedText() const {return m_SelectedText;}
38+ CString GetSelectedText() const { return m_selectedText; }
3839 /// Sets the history object to use
39- void SetHistory(CRegHistory& history) {m_history = &history;}
40+ void SetHistory(CRegHistory& history) { m_history = &history; }
4041 // Dialog Data
41- enum { IDD = IDD_HISTORYDLG };
42+ enum
43+ {
44+ IDD = IDD_HISTORYDLG
45+ };
4246
4347 protected:
44- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
45- virtual BOOL OnInitDialog();
46- virtual BOOL PreTranslateMessage(MSG* pMsg);
47- virtual bool Validate( LPCTSTR string );
48+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
49+ BOOL OnInitDialog() override;
50+ BOOL PreTranslateMessage(MSG* pMsg) override;
51+ bool Validate(LPCWSTR string) override;
4852
4953 afx_msg void OnBnClickedOk();
5054 afx_msg void OnLbnDblclkHistorylist();
@@ -57,8 +61,8 @@
5761 void UpdateMessageList();
5862
5963 private:
60- CHintCtrl<CListBox> m_List;
61- CString m_SelectedText;
64+ CHintCtrl<CListBox> m_list;
65+ CString m_selectedText;
6266 CRegHistory* m_history;
6367 CFilterEdit m_cFilter;
6468 };
--- trunk/src/TortoiseProc/InputDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/InputDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2012, 2014 - TortoiseSVN
3+// Copyright (C) 2003-2012, 2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -19,10 +19,8 @@
1919 #include "stdafx.h"
2020 #include "TortoiseProc.h"
2121 #include "InputDlg.h"
22-#include "registry.h"
2322 #include "AppUtils.h"
2423
25-
2624 IMPLEMENT_DYNAMIC(CInputDlg, CResizableStandAloneDialog)
2725 CInputDlg::CInputDlg(CWnd* pParent /*=NULL*/)
2826 : CResizableStandAloneDialog(CInputDlg::IDD, pParent)
@@ -41,7 +39,6 @@
4139 DDX_Check(pDX, IDC_CHECKBOX, m_iCheck);
4240 }
4341
44-
4542 BEGIN_MESSAGE_MAP(CInputDlg, CResizableStandAloneDialog)
4643 END_MESSAGE_MAP()
4744
@@ -94,7 +91,7 @@
9491 CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
9592 GetDlgItem(IDC_INPUTTEXT)->SetFocus();
9693 // clear the selection
97- m_cInput.Call(SCI_SETSEL, (WPARAM)-1, (LPARAM)-1);
94+ m_cInput.Call(SCI_SETSEL, static_cast<WPARAM>(-1), static_cast<LPARAM>(-1));
9895 return FALSE;
9996 }
10097
@@ -111,13 +108,12 @@
111108 {
112109 switch (pMsg->wParam)
113110 {
114- case VK_RETURN:
115- if (OnEnterPressed())
116- return TRUE;
117- break;
111+ case VK_RETURN:
112+ if (OnEnterPressed())
113+ return TRUE;
114+ break;
118115 }
119116 }
120117
121118 return CResizableStandAloneDialog::PreTranslateMessage(pMsg);
122119 }
123-
--- trunk/src/TortoiseProc/InputDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/InputDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -20,7 +20,6 @@
2020
2121 #include "StandAloneDlg.h"
2222 #include "SciEdit.h"
23-#include "ProjectProperties.h"
2423
2524 /**
2625 * \ingroup TortoiseProc
@@ -31,25 +30,28 @@
3130 DECLARE_DYNAMIC(CInputDlg)
3231
3332 public:
34- CInputDlg(CWnd* pParent = NULL);
35- virtual ~CInputDlg();
33+ CInputDlg(CWnd* pParent = nullptr);
34+ ~CInputDlg() override;
3635
37- enum { IDD = IDD_INPUTDLG };
36+ enum
37+ {
38+ IDD = IDD_INPUTDLG
39+ };
3840
3941 protected:
40- CFont m_logFont;
42+ CFont m_logFont;
4143
42- virtual void DoDataExchange(CDataExchange* pDX);
43- virtual BOOL OnInitDialog();
44- virtual BOOL PreTranslateMessage(MSG* pMsg);
45- virtual void OnOK();
44+ void DoDataExchange(CDataExchange* pDX) override;
45+ BOOL OnInitDialog() override;
46+ BOOL PreTranslateMessage(MSG* pMsg) override;
47+ void OnOK() override;
4648
4749 DECLARE_MESSAGE_MAP()
4850 public:
49- CString m_sInputText;
50- CString m_sHintText;
51- CString m_sTitle;
52- CString m_sCheckText;
53- int m_iCheck;
54- CSciEdit m_cInput;
51+ CString m_sInputText;
52+ CString m_sHintText;
53+ CString m_sTitle;
54+ CString m_sCheckText;
55+ int m_iCheck;
56+ CSciEdit m_cInput;
5557 };
--- trunk/src/TortoiseProc/InputLogDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/InputLogDlg.cpp (revision 29184)
@@ -19,7 +19,6 @@
1919 #include "stdafx.h"
2020 #include "TortoiseProc.h"
2121 #include "InputLogDlg.h"
22-#include "registry.h"
2322 #include "HistoryDlg.h"
2423 #include "RegHistory.h"
2524 #include "AppUtils.h"
@@ -33,11 +32,10 @@
3332
3433 CInputLogDlg::CInputLogDlg(CWnd* pParent /*=NULL*/)
3534 : CResizableStandAloneDialog(CInputLogDlg::IDD, pParent)
36- , m_pProjectProperties(NULL)
35+ , m_pProjectProperties(nullptr)
3736 , m_iCheck(0)
3837 , m_bLock(false)
3938 {
40-
4139 }
4240
4341 CInputLogDlg::~CInputLogDlg()
@@ -52,7 +50,6 @@
5250 DDX_Text(pDX, IDC_BUGID, m_sBugID);
5351 }
5452
55-
5653 BEGIN_MESSAGE_MAP(CInputLogDlg, CResizableStandAloneDialog)
5754 ON_EN_CHANGE(IDC_INPUTTEXT, OnEnChangeLogmessage)
5855 ON_BN_CLICKED(IDC_HISTORY, &CInputLogDlg::OnBnClickedHistory)
@@ -59,7 +56,6 @@
5956 ON_BN_CLICKED(IDC_BUGTRAQBUTTON, &CInputLogDlg::OnBnClickedBugtraqbutton)
6057 END_MESSAGE_MAP()
6158
62-
6359 BOOL CInputLogDlg::OnInitDialog()
6460 {
6561 CResizableStandAloneDialog::OnInitDialog();
@@ -70,7 +66,7 @@
7066 m_aeroControls.SubclassOkCancel(this);
7167
7268 #ifdef DEBUG
73- if (m_pProjectProperties == NULL)
69+ if (m_pProjectProperties == nullptr)
7470 TRACE("InputLogDlg: project properties not set\n");
7571 if (m_sActionText.IsEmpty())
7672 TRACE("InputLogDlg: action text not set\n");
@@ -123,17 +119,17 @@
123119
124120 if (m_pProjectProperties && (!m_rootpath.IsEmpty() || m_pathlist.GetCount()))
125121 {
126- CBugTraqAssociations bugtraq_associations;
127- bugtraq_associations.Load(m_pProjectProperties->GetProviderUUID(), m_pProjectProperties->sProviderParams);
122+ CBugTraqAssociations bugtraqAssociations;
123+ bugtraqAssociations.Load(m_pProjectProperties->GetProviderUUID(), m_pProjectProperties->sProviderParams);
128124
129125 bool bExtendUrlControl = true;
130- bool bFound = bugtraq_associations.FindProvider(m_pathlist, &m_bugtraq_association);
126+ bool bFound = bugtraqAssociations.FindProvider(m_pathlist, &m_bugtraq_association);
131127 if (!bFound)
132- bFound = bugtraq_associations.FindProvider(CTSVNPathList(m_rootpath), &m_bugtraq_association);
128+ bFound = bugtraqAssociations.FindProvider(CTSVNPathList(m_rootpath), &m_bugtraq_association);
133129 if (bFound)
134130 {
135131 CComPtr<IBugTraqProvider> pProvider;
136- HRESULT hr = pProvider.CoCreateInstance(m_bugtraq_association.GetProviderClass());
132+ HRESULT hr = pProvider.CoCreateInstance(m_bugtraq_association.GetProviderClass());
137133 if (SUCCEEDED(hr))
138134 {
139135 m_BugTraqProvider = pProvider;
@@ -182,7 +178,7 @@
182178 m_cInput.SetFocus();
183179 }
184180
185- m_bLock = m_sSVNAction.Compare(PROJECTPROPNAME_LOGTEMPLATELOCK)==0;
181+ m_bLock = m_sSVNAction.Compare(PROJECTPROPNAME_LOGTEMPLATELOCK) == 0;
186182
187183 AddAnchor(IDC_ACTIONLABEL, TOP_LEFT, TOP_RIGHT);
188184 AddAnchor(IDC_BUGIDLABEL, TOP_RIGHT);
@@ -195,8 +191,8 @@
195191 AddAnchor(IDCANCEL, BOTTOM_RIGHT);
196192 AddAnchor(IDOK, BOTTOM_RIGHT);
197193 EnableSaveRestore(L"InputLogDlg");
198- if (FindParentWindow(0))
199- CenterWindow(CWnd::FromHandle(FindParentWindow(0)));
194+ if (FindParentWindow(nullptr))
195+ CenterWindow(CWnd::FromHandle(FindParentWindow(nullptr)));
200196
201197 m_cInput.SetFocus();
202198 return FALSE;
@@ -219,17 +215,17 @@
219215 }
220216 if (!m_bLock && (m_pProjectProperties->bWarnIfNoIssue) && (id.IsEmpty() && !m_pProjectProperties->HasBugID(m_sLogMsg)))
221217 {
222- CTaskDialog taskdlg(CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK1)),
218+ CTaskDialog taskDlg(CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK1)),
223219 CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK2)),
224220 L"TortoiseSVN",
225221 0,
226222 TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
227- taskdlg.AddCommandControl(100, CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK3)));
228- taskdlg.AddCommandControl(200, CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK4)));
229- taskdlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
230- taskdlg.SetDefaultCommandControl(2);
231- taskdlg.SetMainIcon(TD_WARNING_ICON);
232- if (taskdlg.DoModal(m_hWnd) != 100)
223+ taskDlg.AddCommandControl(100, CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK3)));
224+ taskDlg.AddCommandControl(200, CString(MAKEINTRESOURCE(IDS_COMMITDLG_WARNNOISSUE_TASK4)));
225+ taskDlg.SetCommonButtons(TDCBF_CANCEL_BUTTON);
226+ taskDlg.SetDefaultCommandControl(2);
227+ taskDlg.SetMainIcon(TD_WARNING_ICON);
228+ if (taskDlg.DoModal(m_hWnd) != 100)
233229 return;
234230 }
235231 m_sBugID.Trim();
@@ -249,7 +245,7 @@
249245 if (!m_bLock)
250246 {
251247 // now let the bugtraq plugin check the commit message
252- CComPtr<IBugTraqProvider2> pProvider2 = NULL;
248+ CComPtr<IBugTraqProvider2> pProvider2 = nullptr;
253249 if (m_BugTraqProvider)
254250 {
255251 HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider2);
@@ -256,7 +252,7 @@
256252 if (SUCCEEDED(hr))
257253 {
258254 ATL::CComBSTR temp;
259- CString common = m_rootpath.GetSVNPathString();
255+ CString common = m_rootpath.GetSVNPathString();
260256 ATL::CComBSTR repositoryRoot;
261257 repositoryRoot.Attach(common.AllocSysString());
262258 ATL::CComBSTR parameters;
@@ -276,7 +272,7 @@
276272 }
277273 else
278274 {
279- CString sError = temp == 0 ? L"" : temp;
275+ CString sError = temp == 0 ? L"" : static_cast<LPCWSTR>(temp);
280276 if (!sError.IsEmpty())
281277 {
282278 CAppUtils::ReportFailedHook(m_hWnd, sError);
@@ -288,7 +284,7 @@
288284
289285 CTSVNPathList checkedItems;
290286 checkedItems.AddPath(m_rootpath);
291- DWORD exitcode = 0;
287+ DWORD exitcode = 0;
292288 CString error;
293289 CHooks::Instance().SetProjectProperties(m_rootpath, *m_pProjectProperties);
294290 if (CHooks::Instance().CheckCommit(m_hWnd, checkedItems, m_sLogMsg, exitcode, error))
@@ -296,18 +292,18 @@
296292 if (exitcode)
297293 {
298294 CString sErrorMsg;
299- sErrorMsg.Format(IDS_HOOK_ERRORMSG, (LPCWSTR)error);
295+ sErrorMsg.Format(IDS_HOOK_ERRORMSG, static_cast<LPCWSTR>(error));
300296
301- CTaskDialog taskdlg(sErrorMsg,
297+ CTaskDialog taskDlg(sErrorMsg,
302298 CString(MAKEINTRESOURCE(IDS_HOOKFAILED_TASK2)),
303299 L"TortoiseSVN",
304300 0,
305301 TDF_ENABLE_HYPERLINKS | TDF_USE_COMMAND_LINKS | TDF_ALLOW_DIALOG_CANCELLATION | TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT);
306- taskdlg.AddCommandControl(100, CString(MAKEINTRESOURCE(IDS_HOOKFAILED_TASK3)));
307- taskdlg.AddCommandControl(200, CString(MAKEINTRESOURCE(IDS_HOOKFAILED_TASK4)));
308- taskdlg.SetDefaultCommandControl(1);
309- taskdlg.SetMainIcon(TD_ERROR_ICON);
310- bool retry = (taskdlg.DoModal(GetSafeHwnd()) == 100);
302+ taskDlg.AddCommandControl(100, CString(MAKEINTRESOURCE(IDS_HOOKFAILED_TASK3)));
303+ taskDlg.AddCommandControl(200, CString(MAKEINTRESOURCE(IDS_HOOKFAILED_TASK4)));
304+ taskDlg.SetDefaultCommandControl(1);
305+ taskDlg.SetMainIcon(TD_ERROR_ICON);
306+ bool retry = (taskDlg.DoModal(GetSafeHwnd()) == 100);
311307
312308 if (retry)
313309 return;
@@ -317,7 +313,7 @@
317313 }
318314
319315 CString reg;
320- reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", (LPCTSTR)m_sUUID);
316+ reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", static_cast<LPCWSTR>(m_sUUID));
321317
322318 CRegHistory history;
323319 history.Load(reg, L"logmsgs");
@@ -331,12 +327,12 @@
331327 {
332328 CString sMsg = m_cInput.GetText();
333329
334- if (m_BugTraqProvider == NULL)
330+ if (m_BugTraqProvider == nullptr)
335331 return;
336332
337333 ATL::CComBSTR parameters;
338334 parameters.Attach(m_bugtraq_association.GetParameters().AllocSysString());
339- ATL::CComBSTR commonRoot(m_rootpath.GetSVNPathString());
335+ ATL::CComBSTR commonRoot(m_rootpath.GetSVNPathString());
340336 CBstrSafeVector pathList(m_pathlist.GetCount());
341337
342338 for (LONG index = 0; index < m_pathlist.GetCount(); ++index)
@@ -348,12 +344,12 @@
348344 m_revProps.clear();
349345
350346 // first try the IBugTraqProvider2 interface
351- CComPtr<IBugTraqProvider2> pProvider2 = NULL;
352- HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider2);
353- bool bugIdOutSet = false;
347+ CComPtr<IBugTraqProvider2> pProvider2 = nullptr;
348+ HRESULT hr = m_BugTraqProvider.QueryInterface(&pProvider2);
349+ bool bugIdOutSet = false;
354350 if (SUCCEEDED(hr))
355351 {
356- CString common = m_rootpath.GetSVNPathString();
352+ CString common = m_rootpath.GetSVNPathString();
357353 ATL::CComBSTR repositoryRoot;
358354 repositoryRoot.Attach(common.AllocSysString());
359355 ATL::CComBSTR bugIDOut;
@@ -371,17 +367,17 @@
371367 if (bugIDOut)
372368 {
373369 bugIdOutSet = true;
374- m_sBugID = bugIDOut;
370+ m_sBugID = bugIDOut;
375371 SetDlgItemText(IDC_BUGID, m_sBugID);
376372 }
377- m_cInput.SetText((LPCTSTR)temp);
378- BSTR HUGEP *pbRevNames;
379- BSTR HUGEP *pbRevValues;
373+ m_cInput.SetText(static_cast<LPCWSTR>(temp));
374+ BSTR* pbRevNames = nullptr;
375+ BSTR* pbRevValues = nullptr;
380376
381- HRESULT hr1 = SafeArrayAccessData(revPropNames, (void HUGEP**)&pbRevNames);
377+ HRESULT hr1 = SafeArrayAccessData(revPropNames, reinterpret_cast<void**>(&pbRevNames));
382378 if (SUCCEEDED(hr1))
383379 {
384- HRESULT hr2 = SafeArrayAccessData(revPropValues, (void HUGEP**)&pbRevValues);
380+ HRESULT hr2 = SafeArrayAccessData(revPropValues, reinterpret_cast<void**>(&pbRevValues));
385381 if (SUCCEEDED(hr2))
386382 {
387383 if (revPropNames->rgsabound->cElements == revPropValues->rgsabound->cElements)
@@ -400,8 +396,8 @@
400396 else
401397 {
402398 // if IBugTraqProvider2 failed, try IBugTraqProvider
403- CComPtr<IBugTraqProvider> pProvider = NULL;
404- hr = m_BugTraqProvider.QueryInterface(&pProvider);
399+ CComPtr<IBugTraqProvider> pProvider = nullptr;
400+ hr = m_BugTraqProvider.QueryInterface(&pProvider);
405401 if (FAILED(hr))
406402 {
407403 OnComError(hr);
@@ -413,7 +409,7 @@
413409 OnComError(hr);
414410 }
415411 else
416- m_cInput.SetText((LPCTSTR)temp);
412+ m_cInput.SetText(static_cast<LPCWSTR>(temp));
417413 }
418414 m_sLogMsg = m_cInput.GetText();
419415 if (!m_pProjectProperties->sMessage.IsEmpty())
@@ -428,7 +424,6 @@
428424 m_cInput.SetFocus();
429425 }
430426
431-
432427 BOOL CInputLogDlg::PreTranslateMessage(MSG* pMsg)
433428 {
434429 if (pMsg->message == WM_KEYDOWN)
@@ -435,10 +430,10 @@
435430 {
436431 switch (pMsg->wParam)
437432 {
438- case VK_RETURN:
439- if (OnEnterPressed())
440- return TRUE;
441- break;
433+ case VK_RETURN:
434+ if (OnEnterPressed())
435+ return TRUE;
436+ break;
442437 }
443438 }
444439
@@ -452,11 +447,11 @@
452447
453448 void CInputLogDlg::UpdateOKButton()
454449 {
455- CString sTemp = m_cInput.GetText();
456- int minsize = 0;
450+ CString sTemp = m_cInput.GetText();
451+ int minSize = 0;
457452 if (m_pProjectProperties)
458- minsize = m_bLock ? m_pProjectProperties->nMinLockMsgSize : m_pProjectProperties->nMinLogSize;
459- if (sTemp.GetLength() >= minsize)
453+ minSize = m_bLock ? m_pProjectProperties->nMinLockMsgSize : m_pProjectProperties->nMinLogSize;
454+ if (sTemp.GetLength() >= minSize)
460455 {
461456 DialogEnableWindow(IDOK, TRUE);
462457 }
@@ -469,15 +464,15 @@
469464 void CInputLogDlg::OnBnClickedHistory()
470465 {
471466 CString reg;
472- reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", (LPCTSTR)m_sUUID);
467+ reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", static_cast<LPCWSTR>(m_sUUID));
473468 CRegHistory history;
474469 history.Load(reg, L"logmsgs");
475- CHistoryDlg HistoryDlg;
476- HistoryDlg.SetHistory(history);
477- if (HistoryDlg.DoModal()==IDOK)
470+ CHistoryDlg historyDlg;
471+ historyDlg.SetHistory(history);
472+ if (historyDlg.DoModal() == IDOK)
478473 {
479- CString sMsg = HistoryDlg.GetSelectedText();
480- if (sMsg.Compare(m_cInput.GetText().Left(sMsg.GetLength()))!=0)
474+ CString sMsg = historyDlg.GetSelectedText();
475+ if (sMsg.Compare(m_cInput.GetText().Left(sMsg.GetLength())) != 0)
481476 {
482477 CString sBugID = m_pProjectProperties != nullptr ? m_pProjectProperties->FindBugID(sMsg) : L"";
483478 if ((!sBugID.IsEmpty()) && ((GetDlgItem(IDC_BUGID)->IsWindowVisible())))
@@ -484,7 +479,7 @@
484479 {
485480 SetDlgItemText(IDC_BUGID, sBugID);
486481 }
487- if ((m_pProjectProperties)&&(m_pProjectProperties->GetLogMsgTemplate(m_sSVNAction).Compare(m_cInput.GetText())!=0))
482+ if ((m_pProjectProperties) && (m_pProjectProperties->GetLogMsgTemplate(m_sSVNAction).Compare(m_cInput.GetText()) != 0))
488483 m_cInput.InsertText(sMsg, !m_cInput.GetText().IsEmpty());
489484 else
490485 m_cInput.SetText(sMsg);
@@ -495,22 +490,20 @@
495490 }
496491 }
497492
498-void CInputLogDlg::OnComError( HRESULT hr )
493+void CInputLogDlg::OnComError(HRESULT hr) const
499494 {
500495 COMError ce(hr);
501- CString sErr;
502- sErr.FormatMessage(IDS_ERR_FAILEDISSUETRACKERCOM, (LPCWSTR)m_bugtraq_association.GetProviderName(), ce.GetMessageAndDescription().c_str());
496+ CString sErr;
497+ sErr.FormatMessage(IDS_ERR_FAILEDISSUETRACKERCOM, static_cast<LPCWSTR>(m_bugtraq_association.GetProviderName()), ce.GetMessageAndDescription().c_str());
503498 ::MessageBox(m_hWnd, sErr, L"TortoiseSVN", MB_ICONERROR);
504499 }
505500
506-
507-
508501 void CInputLogDlg::OnCancel()
509502 {
510503 UpdateData();
511504 m_sLogMsg = m_cInput.GetText();
512505 CString reg;
513- reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", (LPCTSTR)m_sUUID);
506+ reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", static_cast<LPCWSTR>(m_sUUID));
514507
515508 CRegHistory history;
516509 history.Load(reg, L"logmsgs");
--- trunk/src/TortoiseProc/InputLogDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/InputLogDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2007, 2009-2010, 2013-2014 - TortoiseSVN
3+// Copyright (C) 2003-2007, 2009-2010, 2013-2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -65,7 +65,7 @@
6565
6666 private:
6767 void UpdateOKButton();
68- void OnComError(HRESULT hr);
68+ void OnComError(HRESULT hr) const;
6969
7070
7171 private:
--- trunk/src/TortoiseProc/LogCacheStatisticsDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/LogCacheStatisticsDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2007-2008, 2010, 2014-2015 - TortoiseSVN
3+// Copyright (C) 2007-2008, 2010, 2014-2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,7 +17,6 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "LogCacheStatisticsDlg.h"
2221 #include "LogCacheStatistics.h"
2322 #include "ConnectionState.h"
@@ -27,51 +26,50 @@
2726
2827 IMPLEMENT_DYNAMIC(CLogCacheStatisticsDlg, CStandAloneDialog)
2928
30-CLogCacheStatisticsDlg::CLogCacheStatisticsDlg
31- ( const LogCache::CLogCacheStatisticsData& data, CWnd * pParentWnd)
29+CLogCacheStatisticsDlg::CLogCacheStatisticsDlg(const LogCache::CLogCacheStatisticsData& data, CWnd* pParentWnd)
3230 : CStandAloneDialog(CLogCacheStatisticsDlg::IDD, pParentWnd)
3331 {
34- sizeRAM = ToString (data.ramSize / 1024);
35- sizeDisk = ToString (data.fileSize / 1024);
32+ sizeRAM = ToString(data.ramSize / 1024);
33+ sizeDisk = ToString(data.fileSize / 1024);
3634
3735 switch (data.connectionState)
3836 {
39- case LogCache::online:
40- connectionState.LoadString (IDS_CONNECTIONSTATE_ONLINE);
41- break;
42- case LogCache::tempOffline:
43- connectionState.LoadString (IDS_CONNECTIONSTATE_TEMPOFFLINE);
44- break;
45- case LogCache::offline:
46- connectionState.LoadString (IDS_CONNECTIONSTATE_OFFLINE);
47- break;
37+ case LogCache::online:
38+ connectionState.LoadString(IDS_CONNECTIONSTATE_ONLINE);
39+ break;
40+ case LogCache::tempOffline:
41+ connectionState.LoadString(IDS_CONNECTIONSTATE_TEMPOFFLINE);
42+ break;
43+ case LogCache::offline:
44+ connectionState.LoadString(IDS_CONNECTIONSTATE_OFFLINE);
45+ break;
4846 }
4947
50- lastRead = DateToString (data.lastReadAccess);
51- lastWrite = DateToString (data.lastWriteAccess);
52- lastHeadUpdate = DateToString (data.headTimeStamp);
48+ lastRead = DateToString(data.lastReadAccess);
49+ lastWrite = DateToString(data.lastWriteAccess);
50+ lastHeadUpdate = DateToString(data.headTimeStamp);
5351
54- authors = ToString (data.authorCount);
55- paths = ToString (data.pathCount);
56- pathElements = ToString (data.pathElementCount);
57- skipRanges = ToString (data.skipDeltaCount);
58- wordTokens = ToString (data.wordTokenCount);
59- pairTokens = ToString (data.pairTokenCount);
60- textSize = ToString (data.textSize);
61- uncompressedSize = ToString (data.uncompressedSize);
52+ authors = ToString(data.authorCount);
53+ paths = ToString(data.pathCount);
54+ pathElements = ToString(data.pathElementCount);
55+ skipRanges = ToString(data.skipDeltaCount);
56+ wordTokens = ToString(data.wordTokenCount);
57+ pairTokens = ToString(data.pairTokenCount);
58+ textSize = ToString(data.textSize);
59+ uncompressedSize = ToString(data.uncompressedSize);
6260
63- maxRevision = ToString (data.maxRevision);
64- revisionCount = ToString (data.revisionCount);
61+ maxRevision = ToString(data.maxRevision);
62+ revisionCount = ToString(data.revisionCount);
6563
66- changesTotal = ToString (data.changesCount);
67- changedRevisions = ToString (data.changesRevisionCount);
68- changesMissing = ToString (data.changesMissingRevisionCount);
69- mergesTotal = ToString (data.mergeInfoCount);
70- mergesRevisions = ToString (data.mergeInfoRevisionCount);
71- mergesMissing = ToString (data.mergeInfoMissingRevisionCount);
72- userRevpropsTotal = ToString (data.userRevPropCount);
73- userRevpropsRevisions = ToString (data.userRevPropRevisionCount);
74- userRevpropsMissing = ToString (data.userRevPropMissingRevisionCount);
64+ changesTotal = ToString(data.changesCount);
65+ changedRevisions = ToString(data.changesRevisionCount);
66+ changesMissing = ToString(data.changesMissingRevisionCount);
67+ mergesTotal = ToString(data.mergeInfoCount);
68+ mergesRevisions = ToString(data.mergeInfoRevisionCount);
69+ mergesMissing = ToString(data.mergeInfoMissingRevisionCount);
70+ userRevpropsTotal = ToString(data.userRevPropCount);
71+ userRevpropsRevisions = ToString(data.userRevPropRevisionCount);
72+ userRevpropsMissing = ToString(data.userRevPropMissingRevisionCount);
7573 }
7674
7775 CLogCacheStatisticsDlg::~CLogCacheStatisticsDlg()
@@ -108,29 +106,28 @@
108106 DDX_Text(pDX, IDC_USERREVPROPSMISSING, userRevpropsMissing);
109107 }
110108
111-
112109 BEGIN_MESSAGE_MAP(CLogCacheStatisticsDlg, CStandAloneDialog)
113110 END_MESSAGE_MAP()
114111
115-CString CLogCacheStatisticsDlg::DateToString (__time64_t time)
112+CString CLogCacheStatisticsDlg::DateToString(__time64_t time) const
116113 {
117114 // transform to 1-second base
118115
119- __time64_t systime = time / 1000000L;
120- __time64_t now = CTime::GetCurrentTime().GetTime();
116+ __time64_t sysTime = time / 1000000L;
117+ __time64_t now = CTime::GetCurrentTime().GetTime();
121118
122119 // return time when younger than 1 day
123120 // return date otherwise
124121
125- return (now - systime >= 0) && (now - systime < 86400)
126- ? SVN::formatTime (time)
127- : SVN::formatDate (time);
122+ return (now - sysTime >= 0) && (now - sysTime < 86400)
123+ ? SVN::formatTime(time)
124+ : SVN::formatDate(time);
128125 }
129126
130-CString CLogCacheStatisticsDlg::ToString (__int64 value)
127+CString CLogCacheStatisticsDlg::ToString(__int64 value)
131128 {
132- TCHAR buffer[20] = { 0 };
133- _i64tot_s (value, buffer, _countof (buffer), 10);
129+ wchar_t buffer[20] = {0};
130+ _i64tot_s(value, buffer, _countof(buffer), 10);
134131 return buffer;
135132 }
136133 BOOL CLogCacheStatisticsDlg::OnInitDialog()
@@ -163,7 +160,5 @@
163160 m_tooltips.AddTool(IDC_USERREVPROPSREVISISONS, IDS_SETTINGS_LOGCACHESTATS_USERREVPROPSREVISIONS);
164161 m_tooltips.AddTool(IDC_USERREVPROPSMISSING, IDS_SETTINGS_LOGCACHESTATS_USERREVPROPSMISSING);
165162
166-
167163 return TRUE;
168164 }
169-
--- trunk/src/TortoiseProc/LogCacheStatisticsDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/LogCacheStatisticsDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2007-2008, 2015 - TortoiseSVN
3+// Copyright (C) 2007-2008, 2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -25,28 +25,29 @@
2525
2626 namespace LogCache
2727 {
28- struct CLogCacheStatisticsData;
28+struct CLogCacheStatisticsData;
2929 }
3030
31-
3231 class CLogCacheStatisticsDlg : public CStandAloneDialog
3332 {
3433 DECLARE_DYNAMIC(CLogCacheStatisticsDlg)
3534
3635 public:
37- CLogCacheStatisticsDlg (const LogCache::CLogCacheStatisticsData& data, CWnd * pParentWnd = NULL);
38- virtual ~CLogCacheStatisticsDlg();
36+ CLogCacheStatisticsDlg(const LogCache::CLogCacheStatisticsData& data, CWnd* pParentWnd = nullptr);
37+ ~CLogCacheStatisticsDlg() override;
3938
40- enum { IDD = IDD_LOGCACHESTATISTICS };
39+ enum
40+ {
41+ IDD = IDD_LOGCACHESTATISTICS
42+ };
4143
4244 protected:
43- virtual void DoDataExchange(CDataExchange* pDX);
44- virtual BOOL OnInitDialog();
45+ void DoDataExchange(CDataExchange* pDX) override;
46+ BOOL OnInitDialog() override;
4547
4648 DECLARE_MESSAGE_MAP()
4749
4850 private:
49-
5051 CString sizeRAM;
5152 CString sizeDisk;
5253 CString connectionState;
@@ -73,6 +74,6 @@
7374 CString userRevpropsRevisions;
7475 CString userRevpropsMissing;
7576
76- CString DateToString (__time64_t time);
77- CString ToString (__int64 value);
77+ CString DateToString(__time64_t time) const;
78+ static CString ToString(__int64 value);
7879 };
--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 29184)
@@ -7673,7 +7673,7 @@
76737673 }
76747674 CPropDlg dlg;
76757675 dlg.m_rev = pCmi->rev1;
7676- dlg.m_Path = CTSVNPath(pCmi->fileUrl);
7676+ dlg.m_path = CTSVNPath(pCmi->fileUrl);
76777677 dlg.DoModal();
76787678 }
76797679
--- trunk/src/TortoiseProc/PasswordDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/PasswordDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2014 - TortoiseSVN
3+// Copyright (C) 2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,11 +17,8 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "PasswordDlg.h"
22-#include "afxdialogex.h"
2321
24-
2522 // CPasswordDlg dialog
2623
2724 IMPLEMENT_DYNAMIC(CPasswordDlg, CStandAloneDialog)
@@ -28,11 +25,10 @@
2825
2926 CPasswordDlg::CPasswordDlg(CWnd* pParent /*=NULL*/)
3027 : CStandAloneDialog(CPasswordDlg::IDD, pParent)
31- , m_sPW1(_T(""))
32- , m_sPW2(_T(""))
28+ , m_sPw1(_T(""))
29+ , m_sPw2(_T(""))
3330 , m_bForSave(false)
3431 {
35-
3632 }
3733
3834 CPasswordDlg::~CPasswordDlg()
@@ -42,18 +38,15 @@
4238 void CPasswordDlg::DoDataExchange(CDataExchange* pDX)
4339 {
4440 CStandAloneDialog::DoDataExchange(pDX);
45- DDX_Text(pDX, IDC_PW1, m_sPW1);
46- DDX_Text(pDX, IDC_PW2, m_sPW2);
41+ DDX_Text(pDX, IDC_PW1, m_sPw1);
42+ DDX_Text(pDX, IDC_PW2, m_sPw2);
4743 }
4844
49-
5045 BEGIN_MESSAGE_MAP(CPasswordDlg, CStandAloneDialog)
5146 END_MESSAGE_MAP()
5247
53-
5448 // CPasswordDlg message handlers
5549
56-
5750 BOOL CPasswordDlg::OnInitDialog()
5851 {
5952 CStandAloneDialog::OnInitDialog();
@@ -62,15 +55,14 @@
6255 GetDlgItem(IDC_PW2)->ShowWindow(SW_SHOW);
6356
6457 GetDlgItem(IDC_PW1)->SetFocus();
65- return FALSE; // return TRUE unless you set the focus to a control
58+ return FALSE; // return TRUE unless you set the focus to a control
6659 // EXCEPTION: OCX Property Pages should return FALSE
6760 }
6861
69-
7062 void CPasswordDlg::OnOK()
7163 {
7264 UpdateData(TRUE);
73- if (m_bForSave && (m_sPW1 != m_sPW2))
65+ if (m_bForSave && (m_sPw1 != m_sPw2))
7466 {
7567 // passwords don't match
7668 ShowEditBalloon(IDC_PW1, IDS_ERR_SYNCPW_NOMATCH, IDS_ERR_ERROR, TTI_ERROR);
--- trunk/src/TortoiseProc/PasswordDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/PasswordDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2014 - TortoiseSVN
3+// Copyright (C) 2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -26,20 +26,23 @@
2626 DECLARE_DYNAMIC(CPasswordDlg)
2727
2828 public:
29- CPasswordDlg(CWnd* pParent = NULL); // standard constructor
30- virtual ~CPasswordDlg();
29+ CPasswordDlg(CWnd* pParent = nullptr); // standard constructor
30+ ~CPasswordDlg() override;
3131
32- CString m_sPW1;
33- CString m_sPW2;
34- bool m_bForSave;
32+ CString m_sPw1;
33+ CString m_sPw2;
34+ bool m_bForSave;
3535
36-// Dialog Data
37- enum { IDD = IDD_PASSWORD };
36+ // Dialog Data
37+ enum
38+ {
39+ IDD = IDD_PASSWORD
40+ };
3841
3942 protected:
40- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
41- virtual BOOL OnInitDialog();
42- virtual void OnOK();
43+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
44+ BOOL OnInitDialog() override;
45+ void OnOK() override;
4346
4447 DECLARE_MESSAGE_MAP()
4548 };
--- trunk/src/TortoiseProc/PromptDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/PromptDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010, 2014-2015 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2014-2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -21,13 +21,12 @@
2121 #include "PromptDlg.h"
2222 #include "SVNConfig.h"
2323
24-
2524 IMPLEMENT_DYNAMIC(CPromptDlg, CStandAloneDialog)
2625 CPromptDlg::CPromptDlg(CWnd* pParent /*=NULL*/)
2726 : CStandAloneDialog(CPromptDlg::IDD, pParent)
27+ , m_hide(FALSE)
2828 , m_saveCheck(FALSE)
29- , m_hide(FALSE)
30- , m_hParentWnd(NULL)
29+ , m_hParentWnd(nullptr)
3130 {
3231 }
3332
@@ -52,7 +51,6 @@
5251 BEGIN_MESSAGE_MAP(CPromptDlg, CStandAloneDialog)
5352 END_MESSAGE_MAP()
5453
55-
5654 BOOL CPromptDlg::OnInitDialog()
5755 {
5856 CStandAloneDialog::OnInitDialog();
@@ -61,7 +59,7 @@
6159 m_aeroControls.SubclassControl(this, IDC_SAVECHECK);
6260 m_aeroControls.SubclassOkCancel(this);
6361
64- BOOL bAllowAuthSave = (BOOL)(DWORD)CRegDWORD(L"Software\\TortoiseSVN\\AllowAuthSave", TRUE);
62+ BOOL bAllowAuthSave = static_cast<BOOL>(static_cast<DWORD>(CRegDWORD(L"Software\\TortoiseSVN\\AllowAuthSave", TRUE)));
6563 DialogEnableWindow(IDC_SAVECHECK, bAllowAuthSave);
6664 if (bAllowAuthSave)
6765 CheckDlgButton(IDC_SAVECHECK, SVNConfig::Instance().ConfigGetBool(SVN_CONFIG_SECTION_AUTH, SVN_CONFIG_OPTION_STORE_PASSWORDS, true) ? BST_CHECKED : BST_UNCHECKED);
@@ -78,8 +76,7 @@
7876 }
7977
8078 m_pass.SetFocus();
81- if ((m_hParentWnd==NULL)&&(GetExplorerHWND()))
79+ if ((m_hParentWnd == nullptr) && (GetExplorerHWND()))
8280 CenterWindow(CWnd::FromHandle(m_hParentWnd));
8381 return FALSE;
8482 }
85-
--- trunk/src/TortoiseProc/PromptDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/PromptDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -32,23 +32,27 @@
3232 DECLARE_DYNAMIC(CPromptDlg)
3333
3434 public:
35- CPromptDlg(CWnd* pParent = NULL);
36- virtual ~CPromptDlg();
35+ CPromptDlg(CWnd* pParent = nullptr);
36+ ~CPromptDlg() override;
3737
38- void SetHide(BOOL hide);
38+ void SetHide(BOOL hide);
3939
40- enum { IDD = IDD_PROMPT };
40+ enum
41+ {
42+ IDD = IDD_PROMPT
43+ };
44+
4145 protected:
42- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
43- virtual BOOL OnInitDialog();
46+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
47+ BOOL OnInitDialog() override;
4448
4549 DECLARE_MESSAGE_MAP()
4650
4751 public:
48- CString m_info;
49- CString m_sPass;
50- CEdit m_pass;
51- BOOL m_hide;
52- BOOL m_saveCheck;
53- HWND m_hParentWnd;
52+ CString m_info;
53+ CString m_sPass;
54+ CEdit m_pass;
55+ BOOL m_hide;
56+ BOOL m_saveCheck;
57+ HWND m_hParentWnd;
5458 };
--- trunk/src/TortoiseProc/PropDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/PropDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2015 - TortoiseSVN
3+// Copyright (C) 2003-2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,19 +17,16 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "SVNProperties.h"
2221 #include "UnicodeUtils.h"
2322 #include "PropDlg.h"
24-#include "registry.h"
2523 #include "AppUtils.h"
2624
27-
2825 IMPLEMENT_DYNAMIC(CPropDlg, CResizableStandAloneDialog)
2926 CPropDlg::CPropDlg(CWnd* pParent /*=NULL*/)
3027 : CResizableStandAloneDialog(CPropDlg::IDD, pParent)
3128 , m_rev(SVNRev::REV_WC)
32- , m_hThread(NULL)
29+ , m_hThread(nullptr)
3330 {
3431 }
3532
@@ -40,10 +37,9 @@
4037 void CPropDlg::DoDataExchange(CDataExchange* pDX)
4138 {
4239 CResizableStandAloneDialog::DoDataExchange(pDX);
43- DDX_Control(pDX, IDC_PROPERTYLIST, m_proplist);
40+ DDX_Control(pDX, IDC_PROPERTYLIST, m_propList);
4441 }
4542
46-
4743 BEGIN_MESSAGE_MAP(CPropDlg, CResizableStandAloneDialog)
4844 ON_WM_SETCURSOR()
4945 END_MESSAGE_MAP()
@@ -56,23 +52,23 @@
5652 ExtendFrameIntoClientArea(IDC_PROPERTYLIST, IDC_PROPERTYLIST, IDC_PROPERTYLIST, IDC_PROPERTYLIST);
5753 m_aeroControls.SubclassControl(this, IDOK);
5854
59- m_proplist.SetExtendedStyle ( LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER );
55+ m_propList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
6056
61- m_proplist.DeleteAllItems();
62- int c = m_proplist.GetHeaderCtrl()->GetItemCount()-1;
63- while (c>=0)
64- m_proplist.DeleteColumn(c--);
57+ m_propList.DeleteAllItems();
58+ int c = m_propList.GetHeaderCtrl()->GetItemCount() - 1;
59+ while (c >= 0)
60+ m_propList.DeleteColumn(c--);
6561 CString temp;
6662 temp.LoadString(IDS_PROPPROPERTY);
67- m_proplist.InsertColumn(0, temp);
63+ m_propList.InsertColumn(0, temp);
6864 temp.LoadString(IDS_PROPVALUE);
69- m_proplist.InsertColumn(1, temp);
70- m_proplist.SetRedraw(false);
65+ m_propList.InsertColumn(1, temp);
66+ m_propList.SetRedraw(false);
7167 setProplistColumnWidth();
72- m_proplist.SetRedraw(false);
68+ m_propList.SetRedraw(false);
7369
7470 DialogEnableWindow(IDOK, FALSE);
75- if (AfxBeginThread(PropThreadEntry, this)==NULL)
71+ if (AfxBeginThread(PropThreadEntry, this) == nullptr)
7672 {
7773 OnCantStartThread();
7874 }
@@ -97,17 +93,17 @@
9793
9894 UINT CPropDlg::PropThreadEntry(LPVOID pVoid)
9995 {
100- CCrashReportThread crashthread;
101- return ((CPropDlg*)pVoid)->PropThread();
96+ CCrashReportThread crashThread;
97+ return static_cast<CPropDlg*>(pVoid)->PropThread();
10298 }
10399
104100 UINT CPropDlg::PropThread()
105101 {
106- SVNProperties props(m_Path, m_rev, false, false);
102+ SVNProperties props(m_path, m_rev, false, false);
107103
108- m_proplist.SetRedraw(false);
104+ m_propList.SetRedraw(false);
109105 int row = 0;
110- for (int i=0; i<props.GetCount(); ++i)
106+ for (int i = 0; i < props.GetCount(); ++i)
111107 {
112108 CString name = CUnicodeUtils::StdGetUnicode(props.GetItemName(i)).c_str();
113109 CString val;
@@ -117,19 +113,19 @@
117113 do
118114 {
119115 nFound = val.FindOneOf(L"\r\n");
120- m_proplist.InsertItem(row, name);
116+ m_propList.InsertItem(row, name);
121117 if (nFound >= 0)
122- m_proplist.SetItemText(row++, 1, val.Left(nFound));
118+ m_propList.SetItemText(row++, 1, val.Left(nFound));
123119 else
124- m_proplist.SetItemText(row++, 1, val);
120+ m_propList.SetItemText(row++, 1, val);
125121 val = val.Mid(nFound);
126122 val.Trim();
127123 name.Empty();
128- } while (!val.IsEmpty()&&(nFound>=0));
124+ } while (!val.IsEmpty() && (nFound >= 0));
129125 }
130126 setProplistColumnWidth();
131127
132- m_proplist.SetRedraw(true);
128+ m_propList.SetRedraw(true);
133129 DialogEnableWindow(IDOK, TRUE);
134130 return 0;
135131 }
@@ -136,13 +132,13 @@
136132
137133 BOOL CPropDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
138134 {
139- if ((GetDlgItem(IDOK)->IsWindowEnabled())||(IsCursorOverWindowBorder()))
135+ if ((GetDlgItem(IDOK)->IsWindowEnabled()) || (IsCursorOverWindowBorder()))
140136 {
141- HCURSOR hCur = LoadCursor(NULL, IDC_ARROW);
137+ HCURSOR hCur = LoadCursor(nullptr, IDC_ARROW);
142138 SetCursor(hCur);
143139 return CResizableStandAloneDialog::OnSetCursor(pWnd, nHitTest, message);
144140 }
145- HCURSOR hCur = LoadCursor(NULL, IDC_WAIT);
141+ HCURSOR hCur = LoadCursor(nullptr, IDC_WAIT);
146142 SetCursor(hCur);
147143 return TRUE;
148144 }
@@ -149,9 +145,9 @@
149145
150146 void CPropDlg::setProplistColumnWidth()
151147 {
152- const int maxcol = m_proplist.GetHeaderCtrl()->GetItemCount()-1;
153- for (int col = 0; col <= maxcol; col++)
148+ const int maxCol = m_propList.GetHeaderCtrl()->GetItemCount() - 1;
149+ for (int col = 0; col <= maxCol; col++)
154150 {
155- m_proplist.SetColumnWidth(col,LVSCW_AUTOSIZE_USEHEADER);
151+ m_propList.SetColumnWidth(col, LVSCW_AUTOSIZE_USEHEADER);
156152 }
157153 }
\ No newline at end of file
--- trunk/src/TortoiseProc/PropDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/PropDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2007, 2009-2010, 2017 - TortoiseSVN
3+// Copyright (C) 2003-2007, 2009-2010, 2017, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -31,19 +31,24 @@
3131 DECLARE_DYNAMIC(CPropDlg)
3232
3333 public:
34- CPropDlg(CWnd* pParent = NULL);
35- virtual ~CPropDlg();
34+ CPropDlg(CWnd* pParent = nullptr);
35+ ~CPropDlg() override;
3636
37- enum { IDD = IDD_PROPERTIES };
37+ enum
38+ {
39+ IDD = IDD_PROPERTIES
40+ };
41+
3842 private:
3943 static UINT PropThreadEntry(LPVOID pVoid);
4044 UINT PropThread();
41- void setProplistColumnWidth();
45+ void setProplistColumnWidth();
46+
4247 protected:
43- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
44- virtual BOOL OnInitDialog();
45- virtual void OnCancel();
46- virtual void OnOK();
48+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
49+ BOOL OnInitDialog() override;
50+ void OnCancel() override;
51+ void OnOK() override;
4752
4853 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
4954
@@ -50,10 +55,10 @@
5055 DECLARE_MESSAGE_MAP()
5156
5257 public:
53- CTSVNPath m_Path;
54- SVNRev m_rev;
58+ CTSVNPath m_path;
59+ SVNRev m_rev;
60+
5561 private:
56- HANDLE m_hThread;
57- CHintCtrl<CListCtrl> m_proplist;
62+ HANDLE m_hThread;
63+ CHintCtrl<CListCtrl> m_propList;
5864 };
59-
--- trunk/src/TortoiseProc/RecycleBinDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/RecycleBinDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2011-2014 - TortoiseSVN
3+// Copyright (C) 2011-2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,11 +17,8 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "RecycleBinDlg.h"
22-#include <afxdialogex.h>
2321
24-
2522 // CRecycleBinDlg dialog
2623
2724 IMPLEMENT_DYNAMIC(CRecycleBinDlg, CStandAloneDialog)
@@ -28,11 +25,10 @@
2825
2926 CRecycleBinDlg::CRecycleBinDlg(CWnd* pParent /*=NULL*/)
3027 : CStandAloneDialog(CRecycleBinDlg::IDD, pParent)
28+ , m_startTicks(0)
3129 , m_regDontDoAgain(L"Software\\TortoiseSVN\\RecycleBinSlowDontAskAgain")
3230 , m_bDontAskAgain(FALSE)
33- , m_startTicks(0)
3431 {
35-
3632 }
3733
3834 CRecycleBinDlg::~CRecycleBinDlg()
@@ -46,16 +42,13 @@
4642 DDX_Check(pDX, IDC_DONTASKAGAIN, m_bDontAskAgain);
4743 }
4844
49-
5045 BEGIN_MESSAGE_MAP(CRecycleBinDlg, CStandAloneDialog)
5146 ON_BN_CLICKED(IDC_EMPTYBIN, &CRecycleBinDlg::OnBnClickedEmptybin)
5247 ON_BN_CLICKED(IDC_DONTUSEBIN, &CRecycleBinDlg::OnBnClickedDontusebin)
5348 END_MESSAGE_MAP()
5449
55-
5650 // CRecycleBinDlg message handlers
5751
58-
5952 BOOL CRecycleBinDlg::OnInitDialog()
6053 {
6154 CStandAloneDialog::OnInitDialog();
@@ -73,20 +66,20 @@
7366 return m_startTicks;
7467 }
7568
76-void CRecycleBinDlg::EndTime(int filecount)
69+void CRecycleBinDlg::EndTime(int fileCount)
7770 {
7871 bool tooSlow = false;
79- if (((GetTickCount64() - m_startTicks)/1000) > (5UL+filecount))
72+ if (((GetTickCount64() - m_startTicks) / 1000) > (5UL + fileCount))
8073 tooSlow = true;
8174
82- if ((tooSlow)&&(DWORD(m_regDontDoAgain)==0))
75+ if ((tooSlow) && (static_cast<DWORD>(m_regDontDoAgain) == 0))
8376 {
84- SHQUERYRBINFO SHQueryRBInfo = {sizeof(SHQUERYRBINFO)};
85- if (SHQueryRecycleBin(NULL, &SHQueryRBInfo)==S_OK)
77+ SHQUERYRBINFO shQueryRbInfo = {sizeof(SHQUERYRBINFO)};
78+ if (SHQueryRecycleBin(nullptr, &shQueryRbInfo) == S_OK)
8679 {
87- if (SHQueryRBInfo.i64NumItems > 200)
80+ if (shQueryRbInfo.i64NumItems > 200)
8881 {
89- m_sLabel.FormatMessage(IDS_RECYCLEBINSLOWDOWN, (unsigned long)filecount, (unsigned long)SHQueryRBInfo.i64NumItems);
82+ m_sLabel.FormatMessage(IDS_RECYCLEBINSLOWDOWN, static_cast<unsigned long>(fileCount), static_cast<unsigned long>(shQueryRbInfo.i64NumItems));
9083 DoModal();
9184 }
9285 }
@@ -93,14 +86,12 @@
9386 }
9487 }
9588
96-
9789 void CRecycleBinDlg::OnBnClickedEmptybin()
9890 {
99- SHEmptyRecycleBin(m_hWnd, NULL, SHERB_NOCONFIRMATION);
91+ SHEmptyRecycleBin(m_hWnd, nullptr, SHERB_NOCONFIRMATION);
10092 CStandAloneDialog::OnCancel();
10193 }
10294
103-
10495 void CRecycleBinDlg::OnBnClickedDontusebin()
10596 {
10697 CRegDWORD reg(L"Software\\TortoiseSVN\\RevertWithRecycleBin", TRUE);
@@ -108,7 +99,6 @@
10899 CStandAloneDialog::OnCancel();
109100 }
110101
111-
112102 void CRecycleBinDlg::OnCancel()
113103 {
114104 UpdateData();
--- trunk/src/TortoiseProc/RecycleBinDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/RecycleBinDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2011, 2014 - TortoiseSVN
3+// Copyright (C) 2011, 2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -19,7 +19,6 @@
1919 #pragma once
2020 #include "StandAloneDlg.h"
2121
22-
2322 // CRecycleBinDlg dialog
2423
2524 class CRecycleBinDlg : public CStandAloneDialog
@@ -27,18 +26,22 @@
2726 DECLARE_DYNAMIC(CRecycleBinDlg)
2827
2928 public:
30- CRecycleBinDlg(CWnd* pParent = NULL); // standard constructor
31- virtual ~CRecycleBinDlg();
29+ CRecycleBinDlg(CWnd* pParent = nullptr); // standard constructor
30+ ~CRecycleBinDlg() override;
3231
3332 // Dialog Data
34- enum { IDD = IDD_RECYCLEBIN };
33+ enum
34+ {
35+ IDD = IDD_RECYCLEBIN
36+ };
3537
36- ULONGLONG StartTime();
37- void EndTime(int filecount);
38+ ULONGLONG StartTime();
39+ void EndTime(int fileCount);
40+
3841 protected:
39- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
40- virtual BOOL OnInitDialog();
41- virtual void OnCancel();
42+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
43+ BOOL OnInitDialog() override;
44+ void OnCancel() override;
4245
4346 afx_msg void OnBnClickedEmptybin();
4447 afx_msg void OnBnClickedDontusebin();
@@ -45,8 +48,8 @@
4548 DECLARE_MESSAGE_MAP()
4649
4750 private:
48- ULONGLONG m_startTicks;
49- CRegDWORD m_regDontDoAgain;
50- CString m_sLabel;
51- BOOL m_bDontAskAgain;
51+ ULONGLONG m_startTicks;
52+ CRegDWORD m_regDontDoAgain;
53+ CString m_sLabel;
54+ BOOL m_bDontAskAgain;
5255 };
--- trunk/src/TortoiseProc/RepositoryBrowser.cpp (revision 29183)
+++ trunk/src/TortoiseProc/RepositoryBrowser.cpp (revision 29184)
@@ -4264,7 +4264,7 @@
42644264 {
42654265 CPropDlg dlg(this);
42664266 dlg.m_rev = revision;
4267- dlg.m_Path = selection.GetURLEscaped(0, 0);
4267+ dlg.m_path = selection.GetURLEscaped(0, 0);
42684268 dlg.DoModal();
42694269 }
42704270 }
--- trunk/src/TortoiseProc/RevisionDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/RevisionDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2011, 2013-2015 - TortoiseSVN
3+// Copyright (C) 2003-2011, 2013-2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -19,7 +19,6 @@
1919 #include "stdafx.h"
2020 #include "TortoiseProc.h"
2121 #include "RevisionDlg.h"
22-#include "PathUtils.h"
2322 #include "AppUtils.h"
2423 #include "LogDialog/LogDlg.h"
2524
@@ -41,7 +40,6 @@
4140 DDX_Text(pDX, IDC_REVNUM, m_sRevision);
4241 }
4342
44-
4543 BEGIN_MESSAGE_MAP(CRevisionDlg, CStandAloneDialog)
4644 ON_EN_CHANGE(IDC_REVNUM, OnEnChangeRevnum)
4745 ON_BN_CLICKED(IDC_LOG, &CRevisionDlg::OnBnClickedLog)
@@ -67,13 +65,13 @@
6765 if (IsDate())
6866 sRev = GetDateString();
6967 else
70- sRev.Format(L"%ld", (LONG)(*this));
68+ sRev.Format(L"%ld", static_cast<LONG>(*this));
7169 SetDlgItemText(IDC_REVNUM, sRev);
7270 }
7371 if (!m_logPath.IsEmpty())
7472 GetDlgItem(IDC_LOG)->ShowWindow(SW_SHOW);
7573
76- if ((m_pParentWnd==NULL)&&(GetExplorerHWND()))
74+ if ((m_pParentWnd == nullptr) && (GetExplorerHWND()))
7775 CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
7876 GetDlgItem(IDC_REVNUM)->SetFocus();
7977 return FALSE;
@@ -91,7 +89,7 @@
9189 SVNRev::Create(L"HEAD");
9290 m_sRevision = L"HEAD";
9391 }
94- if ((!IsValid())||((!m_bAllowWCRevs)&&(IsPrev() || IsCommitted() || IsBase())))
92+ if ((!IsValid()) || ((!m_bAllowWCRevs) && (IsPrev() || IsCommitted() || IsBase())))
9593 {
9694 ShowEditBalloon(IDC_REVNUM, m_bAllowWCRevs ? IDS_ERR_INVALIDREV : IDS_ERR_INVALIDREVNOWC, IDS_ERR_ERROR, TTI_ERROR);
9795 return;
@@ -119,21 +117,22 @@
119117 void CRevisionDlg::SetLogPath(const CTSVNPath& path, const SVNRev& r /* = SVNRev::REV_HEAD */)
120118 {
121119 m_logPath = path;
122- m_logRev = r;
120+ m_logRev = r;
123121 }
124122
125123 void CRevisionDlg::OnBnClickedLog()
126124 {
127125 CLogDlg dlg;
128- dlg.SetParams (m_logPath, SVNRev::REV_HEAD, m_logRev, 1);
129- dlg.SetSelect (true);
126+ dlg.SetParams(m_logPath, SVNRev::REV_HEAD, m_logRev, 1);
127+ dlg.SetSelect(true);
130128 if (dlg.DoModal() == IDOK)
131129 {
132130 m_logRev = dlg.GetSelectedRevRanges().GetHighestRevision();
133- SetDlgItemText (IDC_REVNUM, m_logRev.ToString());
131+ SetDlgItemText(IDC_REVNUM, m_logRev.ToString());
134132 }
135133 }
136134
135+// ReSharper disable once CppMemberFunctionMayBeConst
137136 void CRevisionDlg::OnBnClickedRevisionN()
138137 {
139138 GetDlgItem(IDC_REVNUM)->SetFocus();
--- trunk/src/TortoiseProc/RevisionDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/RevisionDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010, 2015 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -18,7 +18,6 @@
1818 //
1919 #pragma once
2020
21-
2221 // For base class
2322 #include "SVNRev.h"
2423 #include "TSVNPath.h"
@@ -28,23 +27,28 @@
2827 * \ingroup TortoiseProc
2928 * A simple dialog box asking the user for a revision number.
3029 */
31-class CRevisionDlg : public CStandAloneDialog, public SVNRev
30+class CRevisionDlg : public CStandAloneDialog
31+ , public SVNRev
3232 {
3333 DECLARE_DYNAMIC(CRevisionDlg)
3434
3535 public:
36- CRevisionDlg(CWnd* pParent = NULL);
37- virtual ~CRevisionDlg();
36+ CRevisionDlg(CWnd* pParent = nullptr);
37+ ~CRevisionDlg() override;
3838
39- enum { IDD = IDD_REVISION };
39+ enum
40+ {
41+ IDD = IDD_REVISION
42+ };
4043
41- CString GetEnteredRevisionString() {return m_sRevision;}
42- void AllowWCRevs(bool bAllowWCRevs = true) {m_bAllowWCRevs = bAllowWCRevs;}
44+ CString GetEnteredRevisionString() const { return m_sRevision; }
45+ void AllowWCRevs(bool bAllowWCRevs = true) { m_bAllowWCRevs = bAllowWCRevs; }
4346 void SetLogPath(const CTSVNPath& path, const SVNRev& r = SVNRev::REV_HEAD);
47+
4448 protected:
45- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
46- virtual BOOL OnInitDialog();
47- virtual void OnOK();
49+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
50+ BOOL OnInitDialog() override;
51+ void OnOK() override;
4852 afx_msg void OnEnChangeRevnum();
4953 afx_msg void OnBnClickedLog();
5054 afx_msg void OnBnClickedRevisionN();
@@ -51,8 +55,8 @@
5155
5256 DECLARE_MESSAGE_MAP()
5357
54- CString m_sRevision;
55- CTSVNPath m_logPath;
56- SVNRev m_logRev;
57- bool m_bAllowWCRevs;
58+ CString m_sRevision;
59+ CTSVNPath m_logPath;
60+ SVNRev m_logRev;
61+ bool m_bAllowWCRevs;
5862 };
--- trunk/src/TortoiseProc/RevisionRangeDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/RevisionRangeDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2011, 2014 - TortoiseSVN
3+// Copyright (C) 2003-2011, 2014, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -21,14 +21,13 @@
2121 #include "AppUtils.h"
2222 #include "RevisionRangeDlg.h"
2323
24-
2524 IMPLEMENT_DYNAMIC(CRevisionRangeDlg, CStandAloneDialog)
2625
2726 CRevisionRangeDlg::CRevisionRangeDlg(CWnd* pParent /*=NULL*/)
2827 : CStandAloneDialog(CRevisionRangeDlg::IDD, pParent)
28+ , m_startRev(L"HEAD")
29+ , m_endRev(L"HEAD")
2930 , m_bAllowWCRevs(true)
30- , m_StartRev(L"HEAD")
31- , m_EndRev(L"HEAD")
3231 {
3332 }
3433
@@ -41,11 +40,10 @@
4140 CStandAloneDialog::DoDataExchange(pDX);
4241 DDX_Text(pDX, IDC_REVNUM, m_sStartRevision);
4342 DDX_Text(pDX, IDC_REVNUM2, m_sEndRevision);
44- DDX_Control(pDX, IDC_REVDATE, m_DateFrom);
45- DDX_Control(pDX, IDC_REVDATE2, m_DateTo);
43+ DDX_Control(pDX, IDC_REVDATE, m_dateFrom);
44+ DDX_Control(pDX, IDC_REVDATE2, m_dateTo);
4645 }
4746
48-
4947 BEGIN_MESSAGE_MAP(CRevisionRangeDlg, CStandAloneDialog)
5048 ON_EN_CHANGE(IDC_REVNUM, OnEnChangeRevnum)
5149 ON_EN_CHANGE(IDC_REVNUM2, OnEnChangeRevnum2)
@@ -61,7 +59,7 @@
6159 ExtendFrameIntoClientArea(IDC_ENDREVGROUP);
6260 m_aeroControls.SubclassOkCancel(this);
6361
64- if (m_StartRev.IsHead())
62+ if (m_startRev.IsHead())
6563 {
6664 CheckRadioButton(IDC_REVRANGE_HEAD, IDC_REVRANGE_DATE, IDC_REVRANGE_HEAD);
6765 }
@@ -68,20 +66,20 @@
6866 else
6967 {
7068 CString sRev;
71- if (m_StartRev.IsDate())
69+ if (m_startRev.IsDate())
7270 {
7371 CheckRadioButton(IDC_REVRANGE_HEAD, IDC_REVRANGE_DATE, IDC_REVRANGE_DATE);
74- sRev = m_StartRev.GetDateString();
72+ sRev = m_startRev.GetDateString();
7573 }
7674 else
7775 {
7876 CheckRadioButton(IDC_REVRANGE_HEAD, IDC_REVRANGE_DATE, IDC_REVRANGE_REV);
79- sRev.Format(L"%ld", (LONG)(m_StartRev));
77+ sRev.Format(L"%ld", static_cast<LONG>(m_startRev));
8078 }
8179 if (!sRev.IsEmpty())
8280 SetDlgItemText(IDC_REVNUM, sRev);
8381 }
84- if (m_EndRev.IsHead())
82+ if (m_endRev.IsHead())
8583 {
8684 CheckRadioButton(IDC_REVRANGE_HEAD2, IDC_REVRANGE_DATE2, IDC_REVRANGE_HEAD2);
8785 }
@@ -88,24 +86,24 @@
8886 else
8987 {
9088 CString sRev;
91- if (m_EndRev.IsDate())
89+ if (m_endRev.IsDate())
9290 {
9391 CheckRadioButton(IDC_REVRANGE_HEAD2, IDC_REVRANGE_DATE2, IDC_REVRANGE_DATE2);
94- sRev = m_EndRev.GetDateString();
92+ sRev = m_endRev.GetDateString();
9593 }
9694 else
9795 {
9896 CheckRadioButton(IDC_REVRANGE_HEAD2, IDC_REVRANGE_DATE2, IDC_REVRANGE_REV2);
99- sRev.Format(L"%ld", (LONG)(m_EndRev));
97+ sRev.Format(L"%ld", static_cast<LONG>(m_endRev));
10098 }
10199 if (!sRev.IsEmpty())
102100 SetDlgItemText(IDC_REVNUM2, sRev);
103101 }
104102
105- m_DateFrom.SendMessage(DTM_SETMCSTYLE, 0, MCS_WEEKNUMBERS|MCS_NOTODAY|MCS_NOTRAILINGDATES|MCS_NOSELCHANGEONNAV);
106- m_DateTo.SendMessage(DTM_SETMCSTYLE, 0, MCS_WEEKNUMBERS|MCS_NOTODAY|MCS_NOTRAILINGDATES|MCS_NOSELCHANGEONNAV);
103+ m_dateFrom.SendMessage(DTM_SETMCSTYLE, 0, MCS_WEEKNUMBERS | MCS_NOTODAY | MCS_NOTRAILINGDATES | MCS_NOSELCHANGEONNAV);
104+ m_dateTo.SendMessage(DTM_SETMCSTYLE, 0, MCS_WEEKNUMBERS | MCS_NOTODAY | MCS_NOTRAILINGDATES | MCS_NOSELCHANGEONNAV);
107105
108- if ((m_pParentWnd==NULL)&&(GetExplorerHWND()))
106+ if ((m_pParentWnd == nullptr) && (GetExplorerHWND()))
109107 CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
110108 GetDlgItem(IDC_REVNUM)->SetFocus();
111109 return FALSE;
@@ -116,53 +114,53 @@
116114 if (!UpdateData(TRUE))
117115 return; // don't dismiss dialog (error message already shown by MFC framework)
118116
119- m_StartRev = SVNRev(m_sStartRevision);
117+ m_startRev = SVNRev(m_sStartRevision);
120118 if (GetCheckedRadioButton(IDC_REVRANGE_HEAD, IDC_REVRANGE_DATE) == IDC_REVRANGE_HEAD)
121119 {
122- m_StartRev = SVNRev(L"HEAD");
120+ m_startRev = SVNRev(L"HEAD");
123121 m_sStartRevision = L"HEAD";
124122 }
125123 if (GetCheckedRadioButton(IDC_REVRANGE_HEAD, IDC_REVRANGE_DATE) == IDC_REVRANGE_DATE)
126124 {
127- CTime _time;
128- m_DateFrom.GetTime(_time);
125+ CTime cTime;
126+ m_dateFrom.GetTime(cTime);
129127 try
130128 {
131- CTime time(_time.GetYear(), _time.GetMonth(), _time.GetDay(), 0, 0, 0);
129+ CTime time(cTime.GetYear(), cTime.GetMonth(), cTime.GetDay(), 0, 0, 0);
132130 m_sStartRevision = time.FormatGmt(L"{%Y-%m-%d}");
133- m_StartRev = SVNRev(m_sStartRevision);
131+ m_startRev = SVNRev(m_sStartRevision);
134132 }
135133 catch (CAtlException)
136134 {
137135 }
138136 }
139- if ((!m_StartRev.IsValid())||((!m_bAllowWCRevs)&&(m_StartRev.IsPrev() || m_StartRev.IsCommitted() || m_StartRev.IsBase())))
137+ if ((!m_startRev.IsValid()) || ((!m_bAllowWCRevs) && (m_startRev.IsPrev() || m_startRev.IsCommitted() || m_startRev.IsBase())))
140138 {
141139 ShowEditBalloon(IDC_REVNUM, m_bAllowWCRevs ? IDS_ERR_INVALIDREV : IDS_ERR_INVALIDREVNOWC, IDS_ERR_ERROR, TTI_ERROR);
142140 return;
143141 }
144142
145- m_EndRev = SVNRev(m_sEndRevision);
143+ m_endRev = SVNRev(m_sEndRevision);
146144 if (GetCheckedRadioButton(IDC_REVRANGE_HEAD2, IDC_REVRANGE_DATE2) == IDC_REVRANGE_HEAD2)
147145 {
148- m_EndRev = SVNRev(L"HEAD");
146+ m_endRev = SVNRev(L"HEAD");
149147 m_sEndRevision = L"HEAD";
150148 }
151149 if (GetCheckedRadioButton(IDC_REVRANGE_HEAD2, IDC_REVRANGE_DATE2) == IDC_REVRANGE_DATE2)
152150 {
153- CTime _time;
154- m_DateTo.GetTime(_time);
151+ CTime cTime;
152+ m_dateTo.GetTime(cTime);
155153 try
156154 {
157- CTime time(_time.GetYear(), _time.GetMonth(), _time.GetDay(), 23, 59, 59);
155+ CTime time(cTime.GetYear(), cTime.GetMonth(), cTime.GetDay(), 23, 59, 59);
158156 m_sEndRevision = time.FormatGmt(L"{%Y-%m-%d}");
159- m_EndRev = SVNRev(m_sEndRevision);
157+ m_endRev = SVNRev(m_sEndRevision);
160158 }
161159 catch (CAtlException)
162160 {
163161 }
164162 }
165- if ((!m_EndRev.IsValid())||((!m_bAllowWCRevs)&&(m_EndRev.IsPrev() || m_EndRev.IsCommitted() || m_EndRev.IsBase())))
163+ if ((!m_endRev.IsValid()) || ((!m_bAllowWCRevs) && (m_endRev.IsPrev() || m_endRev.IsCommitted() || m_endRev.IsBase())))
166164 {
167165 ShowEditBalloon(IDC_REVNUM2, m_bAllowWCRevs ? IDS_ERR_INVALIDREV : IDS_ERR_INVALIDREVNOWC, IDS_ERR_ERROR, TTI_ERROR);
168166 return;
@@ -201,7 +199,7 @@
201199 }
202200 }
203201
204-void CRevisionRangeDlg::OnDtnDatetimechangeDateto(NMHDR * /*pNMHDR*/, LRESULT *pResult)
202+void CRevisionRangeDlg::OnDtnDatetimechangeDateto(NMHDR* /*pNMHDR*/, LRESULT* pResult)
205203 {
206204 CheckRadioButton(IDC_REVRANGE_HEAD2, IDC_REVRANGE_DATE2, IDC_REVRANGE_DATE2);
207205
@@ -208,7 +206,7 @@
208206 *pResult = 0;
209207 }
210208
211-void CRevisionRangeDlg::OnDtnDatetimechangeDatefrom(NMHDR * /*pNMHDR*/, LRESULT *pResult)
209+void CRevisionRangeDlg::OnDtnDatetimechangeDatefrom(NMHDR* /*pNMHDR*/, LRESULT* pResult)
212210 {
213211 CheckRadioButton(IDC_REVRANGE_HEAD, IDC_REVRANGE_DATE, IDC_REVRANGE_DATE);
214212
--- trunk/src/TortoiseProc/RevisionRangeDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/RevisionRangeDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -30,64 +30,68 @@
3030 DECLARE_DYNAMIC(CRevisionRangeDlg)
3131
3232 public:
33- CRevisionRangeDlg(CWnd* pParent = NULL);
34- virtual ~CRevisionRangeDlg();
33+ CRevisionRangeDlg(CWnd* pParent = nullptr);
34+ ~CRevisionRangeDlg() override;
3535
36- enum { IDD = IDD_REVISIONRANGE };
36+ enum
37+ {
38+ IDD = IDD_REVISIONRANGE
39+ };
3740
3841 /**
3942 * Returns the string entered in the start revision edit box.
4043 */
41- CString GetEnteredStartRevisionString() const {return m_sStartRevision;}
44+ CString GetEnteredStartRevisionString() const { return m_sStartRevision; }
4245
4346 /**
4447 * Returns the string entered in the end revision edit box.
4548 */
46- CString GetEnteredEndRevisionString() const {return m_sEndRevision;}
49+ CString GetEnteredEndRevisionString() const { return m_sEndRevision; }
4750
4851 /**
4952 * Returns the entered start revision.
5053 */
51- SVNRev GetStartRevision() const {return m_StartRev;}
54+ SVNRev GetStartRevision() const { return m_startRev; }
5255
5356 /**
5457 * Returns the entered end revision.
5558 */
56- SVNRev GetEndRevision() const {return m_EndRev;}
59+ SVNRev GetEndRevision() const { return m_endRev; }
5760
5861 /**
5962 * Sets the start revision to fill in when the dialog shows up.
6063 */
61- void SetStartRevision(const SVNRev& rev) {m_StartRev = rev;}
64+ void SetStartRevision(const SVNRev& rev) { m_startRev = rev; }
6265
6366 /**
6467 * Sets the end revision to fill in when the dialog shows up.
6568 */
66- void SetEndRevision(const SVNRev& rev) {m_EndRev = rev;}
69+ void SetEndRevision(const SVNRev& rev) { m_endRev = rev; }
6770
6871 /**
6972 * If set to \a true, then working copy revisions like BASE, WC, PREV are allowed.
7073 * Otherwise, an error balloon is shown when the user tries to enter such revisions.
7174 */
72- void AllowWCRevs(bool bAllowWCRevs = true) {m_bAllowWCRevs = bAllowWCRevs;}
75+ void AllowWCRevs(bool bAllowWCRevs = true) { m_bAllowWCRevs = bAllowWCRevs; }
76+
7377 protected:
74- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
75- virtual BOOL OnInitDialog();
76- virtual void OnOK();
78+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
79+ BOOL OnInitDialog() override;
80+ void OnOK() override;
7781 afx_msg void OnEnChangeRevnum();
7882 afx_msg void OnEnChangeRevnum2();
79- afx_msg void OnDtnDatetimechangeDateto(NMHDR *pNMHDR, LRESULT *pResult);
80- afx_msg void OnDtnDatetimechangeDatefrom(NMHDR *pNMHDR, LRESULT *pResult);
83+ afx_msg void OnDtnDatetimechangeDateto(NMHDR* pNMHDR, LRESULT* pResult);
84+ afx_msg void OnDtnDatetimechangeDatefrom(NMHDR* pNMHDR, LRESULT* pResult);
8185
8286 DECLARE_MESSAGE_MAP()
8387
8488 protected:
85- CString m_sStartRevision;
86- CString m_sEndRevision;
87- SVNRev m_StartRev;
88- SVNRev m_EndRev;
89- bool m_bAllowWCRevs;
89+ CString m_sStartRevision;
90+ CString m_sEndRevision;
91+ SVNRev m_startRev;
92+ SVNRev m_endRev;
93+ bool m_bAllowWCRevs;
9094
91- CDateTimeCtrl m_DateFrom;
92- CDateTimeCtrl m_DateTo;
95+ CDateTimeCtrl m_dateFrom;
96+ CDateTimeCtrl m_dateTo;
9397 };
--- trunk/src/TortoiseProc/SimplePrompt.cpp (revision 29183)
+++ trunk/src/TortoiseProc/SimplePrompt.cpp (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010, 2012, 2014-2015, 2017 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2012, 2014-2015, 2017, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -25,7 +25,7 @@
2525 CSimplePrompt::CSimplePrompt(CWnd* pParent /*=NULL*/)
2626 : CStandAloneDialog(CSimplePrompt::IDD, pParent)
2727 , m_bSaveAuthentication(FALSE)
28- , m_hParentWnd(NULL)
28+ , m_hParentWnd(nullptr)
2929 , m_bHideAuthSaveCheck(false)
3030 {
3131 }
@@ -43,7 +43,6 @@
4343 DDX_Text(pDX, IDC_REALM, m_sRealm);
4444 }
4545
46-
4746 BEGIN_MESSAGE_MAP(CSimplePrompt, CStandAloneDialog)
4847 END_MESSAGE_MAP()
4948
@@ -55,7 +54,7 @@
5554 m_aeroControls.SubclassControl(this, IDC_SAVECHECK);
5655 m_aeroControls.SubclassOkCancel(this);
5756
58- BOOL bAllowAuthSave = (BOOL)(DWORD)CRegDWORD(L"Software\\TortoiseSVN\\AllowAuthSave", TRUE);
57+ BOOL bAllowAuthSave = static_cast<BOOL>(static_cast<DWORD>(CRegDWORD(L"Software\\TortoiseSVN\\AllowAuthSave", TRUE)));
5958 DialogEnableWindow(IDC_SAVECHECK, bAllowAuthSave);
6059 if (bAllowAuthSave)
6160 {
@@ -66,7 +65,7 @@
6665 GetDlgItem(IDC_SAVECHECK)->ShowWindow(SW_HIDE);
6766
6867 GetDlgItem(IDC_USEREDIT)->SetFocus();
69- if ((m_hParentWnd==NULL)&&(GetExplorerHWND()))
68+ if ((m_hParentWnd == nullptr) && (GetExplorerHWND()))
7069 CenterWindow(CWnd::FromHandle(m_hParentWnd));
7170 return FALSE;
7271 }
--- trunk/src/TortoiseProc/SimplePrompt.h (revision 29183)
+++ trunk/src/TortoiseProc/SimplePrompt.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2009-2010, 2017 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2009-2010, 2017, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -30,26 +30,29 @@
3030 DECLARE_DYNAMIC(CSimplePrompt)
3131
3232 public:
33- CSimplePrompt(CWnd* pParent = NULL);
34- virtual ~CSimplePrompt();
33+ CSimplePrompt(CWnd* pParent = nullptr);
34+ ~CSimplePrompt() override;
3535
3636 void HideAuthSaveCheckbox(bool b) { m_bHideAuthSaveCheck = b; }
3737
38- enum { IDD = IDD_SIMPLEPROMPT };
38+ enum
39+ {
40+ IDD = IDD_SIMPLEPROMPT
41+ };
3942
4043 protected:
41- virtual void DoDataExchange(CDataExchange* pDX);
42- virtual BOOL OnInitDialog();
44+ void DoDataExchange(CDataExchange* pDX) override;
45+ BOOL OnInitDialog() override;
4346
4447 DECLARE_MESSAGE_MAP()
4548
4649 public:
47- CString m_sUsername;
48- CString m_sPassword;
49- CString m_sRealm;
50- BOOL m_bSaveAuthentication;
51- HWND m_hParentWnd;
50+ CString m_sUsername;
51+ CString m_sPassword;
52+ CString m_sRealm;
53+ BOOL m_bSaveAuthentication;
54+ HWND m_hParentWnd;
5255
5356 private:
54- bool m_bHideAuthSaveCheck;
57+ bool m_bHideAuthSaveCheck;
5558 };
--- trunk/src/TortoiseProc/URLDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/URLDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2015, 2020 - TortoiseSVN
3+// Copyright (C) 2003-2015, 2020-2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,8 +17,6 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-
21-#include "TortoiseProc.h"
2220 #include "URLDlg.h"
2321 #include "ControlsBridge.h"
2422 #include "AppUtils.h"
@@ -36,14 +34,12 @@
3634 void CURLDlg::DoDataExchange(CDataExchange* pDX)
3735 {
3836 CResizableStandAloneDialog::DoDataExchange(pDX);
39- DDX_Control(pDX, IDC_URLCOMBO, m_URLCombo);
37+ DDX_Control(pDX, IDC_URLCOMBO, m_urlCombo);
4038 }
4139
42-
4340 BEGIN_MESSAGE_MAP(CURLDlg, CResizableStandAloneDialog)
4441 END_MESSAGE_MAP()
4542
46-
4743 BOOL CURLDlg::OnInitDialog()
4844 {
4945 CResizableStandAloneDialog::OnInitDialog();
@@ -53,8 +49,8 @@
5349 ExtendFrameIntoClientArea(IDC_DWM);
5450 m_aeroControls.SubclassOkCancel(this);
5551
56- m_URLCombo.SetURLHistory(true, false);
57- m_URLCombo.LoadHistory(L"Software\\TortoiseSVN\\History\\repoURLS", L"url");
52+ m_urlCombo.SetURLHistory(true, false);
53+ m_urlCombo.LoadHistory(L"Software\\TortoiseSVN\\History\\repoURLS", L"url");
5854
5955 CControlsBridge::AlignHorizontally(this, IDC_LABEL, IDC_URLCOMBO);
6056
@@ -68,13 +64,13 @@
6864 // put focus into it so that if the text was too wide to be displayed with
6965 // the original size but it fits into the restored size it is no longer scrolled
7066 // in the edit box of the combo.
71- m_URLCombo.SetCurSel(0);
72- m_URLCombo.SetFocus();
67+ m_urlCombo.SetCurSel(0);
68+ m_urlCombo.SetFocus();
7369
7470 SetTheme(CTheme::Instance().IsDarkTheme());
7571
7672 // if there is an url on the clipboard, use that url as the default.
77- CAppUtils::AddClipboardUrlToWindow(m_URLCombo.GetSafeHwnd());
73+ CAppUtils::AddClipboardUrlToWindow(m_urlCombo.GetSafeHwnd());
7874
7975 return FALSE;
8076 }
@@ -81,14 +77,12 @@
8177
8278 void CURLDlg::OnOK()
8379 {
84- if (m_URLCombo.IsWindowEnabled())
80+ if (m_urlCombo.IsWindowEnabled())
8581 {
86- m_URLCombo.SaveHistory();
87- m_url = m_URLCombo.GetString();
82+ m_urlCombo.SaveHistory();
83+ m_url = m_urlCombo.GetString();
8884 UpdateData();
8985 }
9086
9187 CResizableStandAloneDialog::OnOK();
9288 }
93-
94-
--- trunk/src/TortoiseProc/URLDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/URLDlg.h (revision 29184)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2007, 2009-2010, 2015 - TortoiseSVN
3+// Copyright (C) 2003-2007, 2009-2010, 2015, 2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -18,7 +18,6 @@
1818 //
1919 #pragma once
2020
21-
2221 #include "StandAloneDlg.h"
2322 #include "HistoryCombo.h"
2423
@@ -31,18 +30,22 @@
3130 DECLARE_DYNAMIC(CURLDlg)
3231
3332 public:
34- CURLDlg(CWnd* pParent = NULL);
35- virtual ~CURLDlg();
33+ CURLDlg(CWnd* pParent = nullptr);
34+ ~CURLDlg() override;
3635
3736 CString m_url;
3837
39- enum { IDD = IDD_URL };
38+ enum
39+ {
40+ IDD = IDD_URL
41+ };
42+
4043 protected:
41- virtual void DoDataExchange(CDataExchange* pDX);
42- virtual BOOL OnInitDialog();
43- virtual void OnOK();
44+ void DoDataExchange(CDataExchange* pDX) override;
45+ BOOL OnInitDialog() override;
46+ void OnOK() override;
4447
4548 DECLARE_MESSAGE_MAP()
4649
47- CHistoryCombo m_URLCombo;
50+ CHistoryCombo m_urlCombo;
4851 };
--- trunk/src/TortoiseProc/WaitDlg.cpp (revision 29183)
+++ trunk/src/TortoiseProc/WaitDlg.cpp (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2012, 2013, 2020 - TortoiseSVN
3+// Copyright (C) 2012, 2013, 2020-2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -17,11 +17,8 @@
1717 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1818 //
1919 #include "stdafx.h"
20-#include "TortoiseProc.h"
2120 #include "WaitDlg.h"
22-#include <afxdialogex.h>
2321
24-
2522 // CWaitDlg dialog
2623
2724 IMPLEMENT_DYNAMIC(CWaitDlg, CStandAloneDialog)
@@ -40,14 +37,11 @@
4037 CStandAloneDialog::DoDataExchange(pDX);
4138 }
4239
43-
4440 BEGIN_MESSAGE_MAP(CWaitDlg, CStandAloneDialog)
4541 END_MESSAGE_MAP()
4642
47-
4843 // CWaitDlg message handlers
4944
50-
5145 BOOL CWaitDlg::OnInitDialog()
5246 {
5347 CStandAloneDialog::OnInitDialog();
@@ -56,7 +50,7 @@
5650 SetWindowText(m_title);
5751 SetDlgItemText(IDC_INFO, m_info);
5852
59- return TRUE; // return TRUE unless you set the focus to a control
53+ return TRUE; // return TRUE unless you set the focus to a control
6054 // EXCEPTION: OCX Property Pages should return FALSE
6155 }
6256
--- trunk/src/TortoiseProc/WaitDlg.h (revision 29183)
+++ trunk/src/TortoiseProc/WaitDlg.h (revision 29184)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2012, 2020 - TortoiseSVN
3+// Copyright (C) 2012, 2020-2021 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -19,7 +19,6 @@
1919 #pragma once
2020 #include "StandAloneDlg.h"
2121
22-
2322 // CWaitDlg dialog
2423
2524 class CWaitDlg : public CStandAloneDialog
@@ -27,24 +26,27 @@
2726 DECLARE_DYNAMIC(CWaitDlg)
2827
2928 public:
30- CWaitDlg(CWnd* pParent = NULL); // standard constructor
31- virtual ~CWaitDlg();
29+ CWaitDlg(CWnd* pParent = nullptr); // standard constructor
30+ ~CWaitDlg() override;
3231
3332 void SetTitle(const CString& s) { m_title = s; }
3433 void SetInfo(const CString& s) { m_info = s; }
3534
3635 // Dialog Data
37- enum { IDD = IDD_PLEASEWAIT };
36+ enum
37+ {
38+ IDD = IDD_PLEASEWAIT
39+ };
3840
3941 protected:
40- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
41- virtual BOOL OnInitDialog();
42- virtual void OnCancel();
43- virtual void OnOK();
42+ void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
43+ BOOL OnInitDialog() override;
44+ void OnCancel() override;
45+ void OnOK() override;
4446
4547 DECLARE_MESSAGE_MAP()
4648
4749 private:
48- CString m_title;
49- CString m_info;
50+ CString m_title;
51+ CString m_info;
5052 };
Show on old repository browser