diff --git a/Src/Common/SuperComboBox.cpp b/Src/Common/SuperComboBox.cpp index 8ce33f06b18..bc04b61e9b5 100644 --- a/Src/Common/SuperComboBox.cpp +++ b/Src/Common/SuperComboBox.cpp @@ -321,6 +321,11 @@ void CSuperComboBox::SaveState(LPCTSTR szRegSubKey) AfxGetApp()->WriteProfileInt(szRegSubKey, _T("Empty"), strItem.IsEmpty()); } +void CSuperComboBox::ClearState(LPCTSTR szRegSubKey) +{ + AfxGetApp()->WriteProfileString(szRegSubKey, nullptr, nullptr); +} + BOOL CSuperComboBox::OnEditchange() { if (m_bHasImageList) diff --git a/Src/Common/SuperComboBox.h b/Src/Common/SuperComboBox.h index ddec4f3ff0c..8a54d050c83 100644 --- a/Src/Common/SuperComboBox.h +++ b/Src/Common/SuperComboBox.h @@ -63,6 +63,7 @@ class CSuperComboBox : public CComboBoxEx void SetFileControlStates(bool bCanBeEmpty = false, int nMaxItems = -1); void SaveState(LPCTSTR szRegSubKey); void LoadState(LPCTSTR szRegSubKey); + static void ClearState(LPCTSTR szRegSubKey); bool AttachSystemImageList(); int AddString(LPCTSTR lpszItem); int InsertString(int nIndex, LPCTSTR lpszItem); diff --git a/Src/PropShell.cpp b/Src/PropShell.cpp index 8a316506ac7..3f5413bbf55 100644 --- a/Src/PropShell.cpp +++ b/Src/PropShell.cpp @@ -16,6 +16,7 @@ #include "Win_VersionHelper.h" #include "MergeCmdLineInfo.h" #include "JumpList.h" +#include "SuperComboBox.h" #include "Merge.h" #ifdef _DEBUG @@ -433,6 +434,23 @@ void PropShell::OnUnregisterWinMergeContextMenu() void PropShell::OnClearAllRecentItems() { JumpList::RemoveRecentDocs(); + for (const auto& name : { + _T("ReportFiles"), + _T("Files\\Left"), + _T("Files\\Right"), + _T("Files\\Option"), + _T("Files\\Ext"), + _T("Files\\Unpacker"), + _T("Files\\Prediffer"), + _T("Files\\EditorScript"), + _T("Files\\DiffFileResult"), + _T("Files\\DiffFile1"), + _T("Files\\DiffFile2"), + _T("PatchCreator\\DiffContext"), + }) + { + CSuperComboBox::ClearState(name); + } } void PropShell::OnTimer(UINT_PTR nIDEvent)