From: Takashi Sawanaka Date: Sun, 30 May 2021 01:45:34 +0000 (+0900) Subject: DirView.cpp: Disable Compare As → Text ~ XML in the context menu when the selected... X-Git-Tag: v2.16.13~25 X-Git-Url: http://git.osdn.net/view?p=winmerge-jp%2Fwinmerge-jp.git;a=commitdiff_plain;h=d1c76d9d1af71fdf2ca1a169329078d31d466c48 DirView.cpp: Disable Compare As → Text ~ XML in the context menu when the selected item is a folder or parent folder icon --- diff --git a/Src/DirView.cpp b/Src/DirView.cpp index a4e531248..5b41f2422 100644 --- a/Src/DirView.cpp +++ b/Src/DirView.cpp @@ -1895,7 +1895,7 @@ void CDirView::DoUpdateOpen(SELECTIONTYPE selectionType, CCmdUI* pCmdUI, bool op if (!openableForDir) { const DIFFITEM& di1 = GetDiffItem(sel1); - if (di1.diffcode.isDirectory()) + if (di1.diffcode.isDirectory() || GetItemKey(sel1) == reinterpret_cast(SPECIAL_ITEM_POS)) { pCmdUI->Enable(FALSE); return; @@ -3724,9 +3724,8 @@ void CDirView::OnMergeCompareAs(UINT nID) void CDirView::OnUpdateMergeCompare(CCmdUI *pCmdUI) { - bool openableForDir = (pCmdUI->m_nID != ID_MERGE_COMPARE_XML && - pCmdUI->m_nID != ID_MERGE_COMPARE_HEX && - pCmdUI->m_nID != ID_MERGE_COMPARE_IMAGE); + bool openableForDir = !(pCmdUI->m_nID >= ID_MERGE_COMPARE_TEXT && + pCmdUI->m_nID <= ID_MERGE_COMPARE_XML); DoUpdateOpen(SELECTIONTYPE_NORMAL, pCmdUI, openableForDir); }