mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[0.4.7][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 0.4.10-dev-252-g6e6c46a832
[BROWSEUI] CORE-11141 Re-enable the "Folder Options" menu item (#630) It was originally disabled in SVN r71192 == git8b77c254f8
partially pick 0.4.9-dev-39-gd281d14fd1
[BROWSEUI] Fix a number of Get/SetWindowsLong*Ptr* issues and use GWLP_* instead of GWL_* where appropriate. I picked only the [BROWSEUI] parts 0.4.8-dev-267-gd163627319
[BROWSEUI] Move _ILIsDesktop to a shared header to avoid having 3 instances of it and inspired by parts of 0.4.8-dev-18-g5cb0615147
[BROWSEUI] delete some unused variables in brandband.cpp, desktopipc.cpp, shellbrowser.cpp, toolsband.cpp. Unlike the master commit I really deleted the lines. Enough to have the commented out stuff in master.
This commit is contained in:
parent
b4f12af831
commit
dc95ee394b
8 changed files with 28 additions and 61 deletions
|
@ -43,7 +43,6 @@ inline void FillSolidRect(HDC dc, const RECT *bounds, COLORREF clr)
|
|||
::ExtTextOut(dc, 0, 0, ETO_OPAQUE, bounds, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
static const int gSmallImageSize = 22;
|
||||
static const int gMediumImageSize = 26;
|
||||
static const int gLargeImageSize = 38;
|
||||
|
||||
|
|
|
@ -33,15 +33,9 @@ class CProxyDesktop :
|
|||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public CWindowImpl < CProxyDesktop, CWindow, CFrameWinTraits >
|
||||
{
|
||||
IEThreadParamBlock * m_Parameters;
|
||||
|
||||
LPITEMIDLIST m_rootPidl;
|
||||
|
||||
public:
|
||||
CProxyDesktop(IEThreadParamBlock * parameters) :
|
||||
m_Parameters(parameters)
|
||||
CProxyDesktop(IEThreadParamBlock * parameters)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual ~CProxyDesktop()
|
||||
|
|
|
@ -54,12 +54,6 @@ static BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl)
|
|||
PT_YAGUID == lpPData->type)) || (pidl && pidl->mkid.cb == 0x00)));
|
||||
}
|
||||
|
||||
static BOOL _ILIsDesktop (LPCITEMIDLIST pidl)
|
||||
{
|
||||
return (pidl && pidl->mkid.cb == 0x00);
|
||||
}
|
||||
|
||||
|
||||
HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory,TCHAR *szDisplayName,UINT cchMax,DWORD uFlags)
|
||||
{
|
||||
IShellFolder *pShellFolder = NULL;
|
||||
|
@ -87,7 +81,7 @@ HRESULT GetDisplayName(LPCITEMIDLIST pidlDirectory,TCHAR *szDisplayName,UINT cch
|
|||
}
|
||||
|
||||
/*
|
||||
This is a Windows hack, because shell event messages in Windows gives an
|
||||
This is a Windows hack, because shell event messages in Windows gives an
|
||||
ill-formed PIDL stripped from useful data that parses incorrectly with SHGetFileInfo.
|
||||
So we need to re-enumerate subfolders until we find one with the same name.
|
||||
*/
|
||||
|
@ -150,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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -349,7 +343,7 @@ BOOL CExplorerBand::OnTreeItemDeleted(LPNMTREEVIEW pnmtv)
|
|||
/* Destroy memory associated to our node */
|
||||
NodeInfo* ptr = GetNodeInfo(pnmtv->itemNew.hItem);
|
||||
if (ptr)
|
||||
{
|
||||
{
|
||||
ILFree(ptr->relativePidl);
|
||||
ILFree(ptr->absolutePidl);
|
||||
delete ptr;
|
||||
|
@ -727,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;
|
||||
|
@ -735,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)
|
||||
|
@ -777,7 +769,7 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
|||
// Try to get a child
|
||||
tmp = TreeView_GetChild(m_hWnd, current);
|
||||
if (tmp)
|
||||
{
|
||||
{
|
||||
// We have a child, let's continue with it
|
||||
parent = current;
|
||||
current = tmp;
|
||||
|
@ -812,7 +804,6 @@ BOOL CExplorerBand::NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExp
|
|||
*item = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CExplorerBand::NavigateToCurrentFolder()
|
||||
|
@ -821,7 +812,7 @@ BOOL CExplorerBand::NavigateToCurrentFolder()
|
|||
CComPtr<IBrowserService> pBrowserService;
|
||||
HRESULT hr;
|
||||
HTREEITEM dummy;
|
||||
BOOL result;
|
||||
BOOL result;
|
||||
explorerPidl = NULL;
|
||||
|
||||
hr = IUnknown_QueryService(pSite, SID_STopLevelBrowser, IID_PPV_ARG(IBrowserService, &pBrowserService));
|
||||
|
@ -1142,7 +1133,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::SetSite(IUnknown *pUnkSite)
|
|||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
pSite = pUnkSite;
|
||||
pSite = pUnkSite;
|
||||
|
||||
if (m_hWnd)
|
||||
{
|
||||
|
@ -1220,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);
|
||||
|
@ -1292,6 +1284,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)
|
||||
|
@ -1311,7 +1304,10 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
|
||||
hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
|
||||
if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME))
|
||||
{
|
||||
*theResult = 0;
|
||||
m_isEditing = TRUE;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
case TVN_ENDLABELEDITW:
|
||||
|
@ -1320,6 +1316,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
|
||||
HRESULT hr;
|
||||
|
||||
m_isEditing = FALSE;
|
||||
*theResult = 0;
|
||||
if (dispInfo->item.pszText)
|
||||
{
|
||||
|
@ -1328,8 +1325,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)
|
||||
|
@ -1349,6 +1346,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
// Navigate to our new location
|
||||
UpdateBrowser(pidlNewAbs);
|
||||
|
||||
ILFree(pidlParent);
|
||||
ILFree(pidlNewAbs);
|
||||
ILFree(pidlNew);
|
||||
*theResult = 1;
|
||||
|
|
|
@ -59,6 +59,7 @@ private:
|
|||
BOOL bNavigating;
|
||||
BOOL bFocused;
|
||||
DWORD dwBandID;
|
||||
BOOL m_isEditing;
|
||||
HIMAGELIST hImageList;
|
||||
HTREEITEM hRoot;
|
||||
HTREEITEM oldSelected;
|
||||
|
@ -95,7 +96,7 @@ private:
|
|||
HRESULT UpdateBrowser(LPITEMIDLIST pidlGoto);
|
||||
HTREEITEM InsertItem(HTREEITEM hParent, IShellFolder *psfParent, LPITEMIDLIST pElt, LPITEMIDLIST pEltRelative, BOOL bSort);
|
||||
HTREEITEM InsertItem(HTREEITEM hParent, LPITEMIDLIST pElt, LPITEMIDLIST pEltRelative, BOOL bSort);
|
||||
BOOL InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo);
|
||||
BOOL InsertSubitems(HTREEITEM hItem, NodeInfo *pNodeInfo);
|
||||
BOOL NavigateToPIDL(LPITEMIDLIST dest, HTREEITEM *item, BOOL bExpand, BOOL bInsert, BOOL bSelect);
|
||||
BOOL DeleteItem(LPITEMIDLIST toDelete);
|
||||
BOOL RenameItem(HTREEITEM toRename, LPITEMIDLIST newPidl);
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
extern inline BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
|
||||
{
|
||||
return (pidl == NULL || pidl->mkid.cb == 0);
|
||||
}
|
||||
|
||||
class CBandSiteBase :
|
||||
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
||||
public IBandSite,
|
||||
|
|
|
@ -13,23 +13,6 @@
|
|||
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
|
||||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||
|
||||
// ***Extras***
|
||||
/*++
|
||||
* @name _ILIsDesktop
|
||||
*
|
||||
* Checks whether the given PIDL is of Desktop folder or not.
|
||||
*
|
||||
* @param pidl
|
||||
* PIDL to be checked.
|
||||
*
|
||||
* @return True if PIDL is of Desktop, otherwise false.
|
||||
*
|
||||
*--*/
|
||||
static BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
|
||||
{
|
||||
return (pidl == NULL || pidl->mkid.cb == 0);
|
||||
}
|
||||
|
||||
//*****************************************************************************************
|
||||
// *** CISFBand ***
|
||||
|
||||
|
|
|
@ -167,7 +167,6 @@ HRESULT WINAPI SHBindToFolder(LPCITEMIDLIST path, IShellFolder **newFolder)
|
|||
}
|
||||
|
||||
static const TCHAR szCabinetWndClass[] = TEXT("CabinetWClass");
|
||||
static const TCHAR szExploreWndClass[] = TEXT("ExploreWClass");
|
||||
|
||||
class CDockManager;
|
||||
class CShellBrowser;
|
||||
|
@ -818,11 +817,6 @@ HRESULT CShellBrowser::BrowseToPIDL(LPCITEMIDLIST pidl, long flags)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
BOOL WINAPI _ILIsDesktop(LPCITEMIDLIST pidl)
|
||||
{
|
||||
return (pidl == NULL || pidl->mkid.cb == 0);
|
||||
}
|
||||
|
||||
BOOL WINAPI _ILIsPidlSimple(LPCITEMIDLIST pidl)
|
||||
{
|
||||
LPCITEMIDLIST pidlnext;
|
||||
|
@ -1402,10 +1396,10 @@ LRESULT CALLBACK CShellBrowser::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
{
|
||||
if (uMsg == WM_NCDESTROY)
|
||||
{
|
||||
saveWindowProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWL_WNDPROC));
|
||||
saveWindowProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWLP_WNDPROC));
|
||||
lResult = pThis->DefWindowProc(uMsg, wParam, lParam);
|
||||
if (saveWindowProc == reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWL_WNDPROC)))
|
||||
::SetWindowLongPtr(hWnd, GWL_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);
|
||||
if (saveWindowProc == reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hWnd, GWLP_WNDPROC)))
|
||||
::SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);
|
||||
pThis->m_dwState |= WINSTATE_DESTROYED;
|
||||
}
|
||||
else
|
||||
|
@ -3487,8 +3481,6 @@ LRESULT CShellBrowser::OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam,
|
|||
SHEnableMenuItem(theMenu, IDM_TOOLS_MAPNETWORKDRIVE, FALSE);
|
||||
SHEnableMenuItem(theMenu, IDM_TOOLS_DISCONNECTNETWORKDRIVE, FALSE);
|
||||
SHEnableMenuItem(theMenu, IDM_TOOLS_SYNCHRONIZE, FALSE);
|
||||
FIXME("Folder options dialog is stubbed: CORE-11141\n");
|
||||
SHEnableMenuItem(theMenu, IDM_TOOLS_FOLDEROPTIONS, FALSE); // Remove when CORE-11141 is fixed.
|
||||
menuIndex = 4;
|
||||
}
|
||||
else if (theMenu == SHGetMenuFromID(fCurrentMenuBar, FCIDM_MENU_HELP))
|
||||
|
|
|
@ -38,8 +38,6 @@ class CToolsBand :
|
|||
{
|
||||
private:
|
||||
CComPtr<IDockingWindowSite> fDockSite;
|
||||
GUID fExecCommandCategory;
|
||||
CComPtr<IOleCommandTarget> fExecCommandTarget;
|
||||
HIMAGELIST m_himlNormal;
|
||||
HIMAGELIST m_himlHot;
|
||||
public:
|
||||
|
@ -163,7 +161,6 @@ static const int cutImageIndex = 5;
|
|||
static const int copyImageIndex = 6;
|
||||
static const int pasteImageIndex = 7;
|
||||
static const int undoImageIndex = 8;
|
||||
static const int redoImageIndex = 9;
|
||||
static const int deleteImageIndex = 10;
|
||||
// 11
|
||||
// 12
|
||||
|
@ -186,13 +183,11 @@ static const int upImageIndex = 28;
|
|||
static const int mapDriveImageIndex = 29;
|
||||
static const int disconnectImageIndex = 30;
|
||||
// 31
|
||||
static const int viewsAltImageIndex = 32; // same image as viewsImageIndex
|
||||
// 33
|
||||
// 34
|
||||
// 35
|
||||
// 36
|
||||
// 37
|
||||
static const int viewsAlt2ImageIndex = 38; // same image as viewsAltImageIndex & viewsImageIndex
|
||||
// 39
|
||||
// 40
|
||||
// 41
|
||||
|
|
Loading…
Reference in a new issue