summaryrefslogtreecommitdiff
path: root/extensions/source/update/check/updatecheckconfig.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-25 19:22:43 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-26 02:24:46 +0100
commit276f8ef88083e4ed9ab21989b2eb5de6222dbf5d (patch)
tree670c5c1ef2af021e37a486fb9ae468bdf30cd5fe /extensions/source/update/check/updatecheckconfig.cxx
parent5e134896f35d5c3a194090f2af1b84fbaec8b432 (diff)
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>
Diffstat (limited to 'extensions/source/update/check/updatecheckconfig.cxx')
-rw-r--r--extensions/source/update/check/updatecheckconfig.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index 708aba65811d..52deb59528fb 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -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