mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[0.4.11][BROWSEUI] Port back several fixes and tweaks
0.4.15-dev-5688-g460a01b167
[BROWSEUI] CORE-18646 Fix crash while editing a label in the folder tree, add missing break 0.4.15-dev-5686-ga777cc2cc4
[BROWSEUI] CORE-18646 Fix crash on backspace while editing a label in the folder panel (#5059) 0.4.15-dev-4497-gbeefb07d18
[BROWSEUI] CORE-12804 Remove useless variable and unreachable code (#4483) and strip EOL whitespace 0.4.13-dev-1186-gd41c5be3bd
[BROWSEUI] Fix a PIDL leak. 0.4.13-dev-283-g801ec51a91
[BROWSEUI] Fix indentation
This commit is contained in:
parent
a3f9e8b6ea
commit
635cc55d26
2 changed files with 22 additions and 16 deletions
|
@ -144,7 +144,7 @@ Cleanup:
|
|||
}
|
||||
|
||||
CExplorerBand::CExplorerBand() :
|
||||
pSite(NULL), fVisible(FALSE), bNavigating(FALSE), dwBandID(0), pidlCurrent(NULL)
|
||||
pSite(NULL), fVisible(FALSE), bNavigating(FALSE), dwBandID(0), m_isEditing(FALSE), pidlCurrent(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -721,7 +721,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
|||
HTREEITEM current;
|
||||
HTREEITEM tmp;
|
||||
HTREEITEM parent;
|
||||
BOOL found;
|
||||
NodeInfo *nodeData;
|
||||
LPITEMIDLIST relativeChild;
|
||||
TVITEM tvItem;
|
||||
|
@ -729,10 +728,9 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
|||
if (!item)
|
||||
return FALSE;
|
||||
|
||||
found = FALSE;
|
||||
current = hRoot;
|
||||
parent = NULL;
|
||||
while(!found)
|
||||
while (TRUE)
|
||||
{
|
||||
nodeData = GetNodeInfo(current);
|
||||
if (!nodeData)
|
||||
|
@ -806,7 +804,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
|||
*item = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CExplorerBand::NavigateToCurrentFolder()
|
||||
|
@ -1214,7 +1211,8 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::HasFocusIO()
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
||||
{
|
||||
if (lpMsg->hwnd == m_hWnd)
|
||||
if (lpMsg->hwnd == m_hWnd ||
|
||||
(m_isEditing && IsChild(lpMsg->hwnd)))
|
||||
{
|
||||
TranslateMessage(lpMsg);
|
||||
DispatchMessage(lpMsg);
|
||||
|
@ -1291,6 +1289,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
case TVN_BEGINDRAG:
|
||||
case TVN_BEGINRDRAG:
|
||||
OnTreeItemDragging((LPNMTREEVIEW)lParam, pNotifyHeader->code == TVN_BEGINRDRAG);
|
||||
break;
|
||||
case TVN_BEGINLABELEDITW:
|
||||
{
|
||||
// TODO: put this in a function ? (mostly copypasta from CDefView)
|
||||
|
@ -1310,8 +1309,12 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
return E_FAIL;
|
||||
|
||||
hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
|
||||
if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME) && theResult)
|
||||
*theResult = 0;
|
||||
if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME))
|
||||
{
|
||||
if (theResult)
|
||||
*theResult = 0;
|
||||
m_isEditing = TRUE;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
case TVN_ENDLABELEDITW:
|
||||
|
@ -1320,6 +1323,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
|
||||
HRESULT hr;
|
||||
|
||||
m_isEditing = FALSE;
|
||||
if (theResult)
|
||||
*theResult = 0;
|
||||
if (dispInfo->item.pszText)
|
||||
|
@ -1329,8 +1333,8 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
LPCITEMIDLIST pidlChild;
|
||||
|
||||
hr = SHBindToParent(info->absolutePidl, IID_PPV_ARG(IShellFolder, &pParent), &pidlChild);
|
||||
if (!SUCCEEDED(hr) || !pParent.p)
|
||||
return E_FAIL;
|
||||
if (!SUCCEEDED(hr) || !pParent.p)
|
||||
return E_FAIL;
|
||||
|
||||
hr = pParent->SetNameOf(0, pidlChild, dispInfo->item.pszText, SHGDN_INFOLDER, &pidlNew);
|
||||
if(SUCCEEDED(hr) && pidlNew)
|
||||
|
@ -1350,6 +1354,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
// Navigate to our new location
|
||||
UpdateBrowser(pidlNewAbs);
|
||||
|
||||
ILFree(pidlParent);
|
||||
ILFree(pidlNewAbs);
|
||||
ILFree(pidlNew);
|
||||
if (theResult)
|
||||
|
|
|
@ -59,6 +59,7 @@ private:
|
|||
BOOL bNavigating;
|
||||
BOOL bFocused;
|
||||
DWORD dwBandID;
|
||||
BOOL m_isEditing;
|
||||
HIMAGELIST hImageList;
|
||||
HTREEITEM hRoot;
|
||||
HTREEITEM oldSelected;
|
||||
|
|
Loading…
Reference in a new issue