mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[BROWSEUI] CBandSiteMenu: Fix two broken loops
This commit is contained in:
parent
3e812a66ff
commit
0ed80264f9
1 changed files with 2 additions and 8 deletions
|
@ -119,7 +119,6 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu(
|
|||
CComPtr<IPersist> pBand;
|
||||
CLSID BandCLSID;
|
||||
DWORD dwBandID;
|
||||
UINT uBand = 0;
|
||||
|
||||
TRACE("CBandSiteMenu::QueryContextMenu(%p, %p, %u, %u, %u, 0x%x)\n", this, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
|
||||
|
||||
|
@ -129,7 +128,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu(
|
|||
HMENU hmenuToolbars = GetSubMenu(hmenu, indexMenu);
|
||||
|
||||
/* Enumerate all present bands and mark them as checked in the menu */
|
||||
while (SUCCEEDED(m_BandSite->EnumBands(uBand, &dwBandID)))
|
||||
for (UINT uBand = 0; SUCCEEDED(m_BandSite->EnumBands(uBand, &dwBandID)); uBand++)
|
||||
{
|
||||
if (FAILED(m_BandSite->GetBandObject(dwBandID, IID_PPV_ARG(IPersist, &pBand))))
|
||||
continue;
|
||||
|
@ -148,8 +147,6 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu(
|
|||
CheckMenuItem(hmenuToolbars, i, MF_CHECKED | MF_BYPOSITION);
|
||||
}
|
||||
}
|
||||
|
||||
uBand++;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
@ -171,8 +168,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpi
|
|||
CComPtr<IPersist> pBand;
|
||||
CLSID BandCLSID;
|
||||
DWORD dwBandID;
|
||||
UINT uBand = 0;
|
||||
while (SUCCEEDED(m_BandSite->EnumBands(uBand, &dwBandID)))
|
||||
for (UINT uBand = 0; SUCCEEDED(m_BandSite->EnumBands(uBand, &dwBandID)); uBand++)
|
||||
{
|
||||
if (FAILED(m_BandSite->GetBandObject(dwBandID, IID_PPV_ARG(IPersist, &pBand))))
|
||||
continue;
|
||||
|
@ -186,8 +182,6 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpi
|
|||
m_BandSite->RemoveBand(dwBandID);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
uBand++;
|
||||
}
|
||||
|
||||
/* It is not present. Add it. */
|
||||
|
|
Loading…
Reference in a new issue