mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 01:03:16 +00:00
[0.4.14][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
This commit is contained in:
parent
49a8636437
commit
1ee4e28d75
2 changed files with 18 additions and 12 deletions
|
@ -149,6 +149,7 @@ CExplorerBand::CExplorerBand()
|
||||||
, m_fVisible(FALSE)
|
, m_fVisible(FALSE)
|
||||||
, m_bNavigating(FALSE)
|
, m_bNavigating(FALSE)
|
||||||
, m_dwBandID(0)
|
, m_dwBandID(0)
|
||||||
|
, m_isEditing(FALSE)
|
||||||
, m_pidlCurrent(NULL)
|
, m_pidlCurrent(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -726,7 +727,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
||||||
HTREEITEM current;
|
HTREEITEM current;
|
||||||
HTREEITEM tmp;
|
HTREEITEM tmp;
|
||||||
HTREEITEM parent;
|
HTREEITEM parent;
|
||||||
BOOL found;
|
|
||||||
NodeInfo *nodeData;
|
NodeInfo *nodeData;
|
||||||
LPITEMIDLIST relativeChild;
|
LPITEMIDLIST relativeChild;
|
||||||
TVITEM tvItem;
|
TVITEM tvItem;
|
||||||
|
@ -734,10 +734,9 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
||||||
if (!item)
|
if (!item)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
found = FALSE;
|
|
||||||
current = m_hRoot;
|
current = m_hRoot;
|
||||||
parent = NULL;
|
parent = NULL;
|
||||||
while(!found)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
nodeData = GetNodeInfo(current);
|
nodeData = GetNodeInfo(current);
|
||||||
if (!nodeData)
|
if (!nodeData)
|
||||||
|
@ -811,7 +810,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
||||||
*item = NULL;
|
*item = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CExplorerBand::NavigateToCurrentFolder()
|
BOOL CExplorerBand::NavigateToCurrentFolder()
|
||||||
|
@ -1219,7 +1217,8 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::HasFocusIO()
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
||||||
{
|
{
|
||||||
if (lpMsg->hwnd == m_hWnd)
|
if (lpMsg->hwnd == m_hWnd ||
|
||||||
|
(m_isEditing && IsChild(lpMsg->hwnd)))
|
||||||
{
|
{
|
||||||
TranslateMessage(lpMsg);
|
TranslateMessage(lpMsg);
|
||||||
DispatchMessage(lpMsg);
|
DispatchMessage(lpMsg);
|
||||||
|
@ -1296,6 +1295,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
||||||
case TVN_BEGINDRAG:
|
case TVN_BEGINDRAG:
|
||||||
case TVN_BEGINRDRAG:
|
case TVN_BEGINRDRAG:
|
||||||
OnTreeItemDragging((LPNMTREEVIEW)lParam, pNotifyHeader->code == TVN_BEGINRDRAG);
|
OnTreeItemDragging((LPNMTREEVIEW)lParam, pNotifyHeader->code == TVN_BEGINRDRAG);
|
||||||
|
break;
|
||||||
case TVN_BEGINLABELEDITW:
|
case TVN_BEGINLABELEDITW:
|
||||||
{
|
{
|
||||||
// TODO: put this in a function ? (mostly copypasta from CDefView)
|
// TODO: put this in a function ? (mostly copypasta from CDefView)
|
||||||
|
@ -1315,8 +1315,12 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
|
hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
|
||||||
if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME) && theResult)
|
if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME))
|
||||||
|
{
|
||||||
|
if (theResult)
|
||||||
*theResult = 0;
|
*theResult = 0;
|
||||||
|
m_isEditing = TRUE;
|
||||||
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
case TVN_ENDLABELEDITW:
|
case TVN_ENDLABELEDITW:
|
||||||
|
@ -1325,6 +1329,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
||||||
NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
|
NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
m_isEditing = FALSE;
|
||||||
if (theResult)
|
if (theResult)
|
||||||
*theResult = 0;
|
*theResult = 0;
|
||||||
if (dispInfo->item.pszText)
|
if (dispInfo->item.pszText)
|
||||||
|
|
|
@ -60,6 +60,7 @@ private:
|
||||||
BOOL m_bNavigating;
|
BOOL m_bNavigating;
|
||||||
BOOL m_bFocused;
|
BOOL m_bFocused;
|
||||||
DWORD m_dwBandID;
|
DWORD m_dwBandID;
|
||||||
|
BOOL m_isEditing;
|
||||||
HIMAGELIST m_hImageList;
|
HIMAGELIST m_hImageList;
|
||||||
HTREEITEM m_hRoot;
|
HTREEITEM m_hRoot;
|
||||||
HTREEITEM m_oldSelected;
|
HTREEITEM m_oldSelected;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue