[0.4.14][SHELL32] Revert CDefView::FillFileMenu (#5278)

this fixes:
CORE-18429 Explorer should not have duplicated menus in the File menu

It regressed by
0.4.14-dev-955-g1cf564c 1cf564c25f

And we do now mention here CORE-9467
(and its duplicate CORE-11797 also) to make us
aware there is still something to do in this context. The guilty rev
aimed to fix those. But it wasn't the right thing to do.

by porting back the revert:
0.4.15-dev-6039-g 0fa4edebd9 and addendum
0.4.15-dev-6083-g d3164a0f55
This commit is contained in:
Joachim Henze 2023-06-13 19:08:04 +02:00
parent cde9eea79e
commit d2cbda09c5

View file

@ -1241,11 +1241,8 @@ HRESULT CDefView::FillFileMenu()
DeleteMenu(hFileMenu, i, MF_BYPOSITION);
}
m_cidl = m_ListView.GetSelectedCount();
/* Store the context menu in m_pCM and keep it in order to invoke the selected command later on */
HRESULT hr = GetItemObject((m_cidl ? SVGIO_SELECTION : SVGIO_BACKGROUND),
IID_PPV_ARG(IContextMenu, &m_pCM));
HRESULT hr = GetItemObject(SVGIO_SELECTION, IID_PPV_ARG(IContextMenu, &m_pCM));
if (FAILED_UNEXPECTEDLY(hr))
return hr;