mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:56:00 +00:00
[BROWSEUI] Fix auto-completion on relative paths (#3578)
Fix the CLSID_ACListISF object about relative paths. If the given path is relative at CACListISF::Expand, then convert it to a full path. CORE-9281
This commit is contained in:
parent
e771589ae1
commit
206156fad5
1 changed files with 13 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
* Shell AutoComplete list
|
* Shell AutoComplete list
|
||||||
*
|
*
|
||||||
* Copyright 2015 Thomas Faber
|
* Copyright 2015 Thomas Faber
|
||||||
* Copyright 2020 Katayama Hirofumi MZ
|
* Copyright 2020-2021 Katayama Hirofumi MZ
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -329,10 +329,20 @@ STDMETHODIMP CACListISF::Expand(LPCOLESTR pszExpand)
|
||||||
TRACE("(%p, %ls)\n", this, pszExpand);
|
TRACE("(%p, %ls)\n", this, pszExpand);
|
||||||
|
|
||||||
m_szExpand = pszExpand;
|
m_szExpand = pszExpand;
|
||||||
|
|
||||||
m_iNextLocation = LT_DIRECTORY;
|
m_iNextLocation = LT_DIRECTORY;
|
||||||
|
|
||||||
|
// get full path
|
||||||
|
WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH];
|
||||||
|
if (PathIsRelativeW(pszExpand) &&
|
||||||
|
SHGetPathFromIDListW(m_pidlCurDir, szPath1) &&
|
||||||
|
PathCombineW(szPath2, szPath1, pszExpand))
|
||||||
|
{
|
||||||
|
pszExpand = szPath2;
|
||||||
|
}
|
||||||
|
GetFullPathNameW(pszExpand, _countof(szPath1), szPath1, NULL);
|
||||||
|
|
||||||
CComHeapPtr<ITEMIDLIST> pidl;
|
CComHeapPtr<ITEMIDLIST> pidl;
|
||||||
HRESULT hr = SHParseDisplayName(m_szExpand, NULL, &pidl, NULL, NULL);
|
HRESULT hr = SHParseDisplayName(szPath1, NULL, &pidl, NULL, NULL);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = SetLocation(pidl.Detach());
|
hr = SetLocation(pidl.Detach());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue