Use SHGetKnownFolderPath to avoid MAX_PATH limitation
Change-Id: Icba230fedc9e6071d3817454f55d4533727e3aa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163916 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
5e134896f3
commit
276f8ef880
1 changed files with 3 additions and 3 deletions
|
@ -183,13 +183,13 @@ OUString UpdateCheckConfig::getAllUsersDirectory()
|
|||
OUString aRet;
|
||||
|
||||
#ifdef _WIN32
|
||||
WCHAR szPath[MAX_PATH];
|
||||
|
||||
if (TRUE == SHGetSpecialFolderPathW(nullptr, szPath, CSIDL_COMMON_DOCUMENTS, true))
|
||||
PWSTR szPath = nullptr;
|
||||
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_PublicDocuments, KF_FLAG_CREATE, nullptr, &szPath)))
|
||||
{
|
||||
aRet = o3tl::toU(szPath);
|
||||
osl::FileBase::getFileURLFromSystemPath( aRet, aRet );
|
||||
}
|
||||
CoTaskMemFree(szPath);
|
||||
#else
|
||||
osl::FileBase::getTempDirURL(aRet);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue