sfx2/source/appl/shutdowniconw32.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 99e88bb7497c7d31e660fa5e693b488bafdbf703 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sat Jan 18 18:49:50 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Jan 18 20:06:09 2025 +0100 Use EXTENDED_MAX_PATH in ShutdownIcon Allows to use long paths in quickstarter, could be useful when the program is in a deeply nested directory. Change-Id: Iba6f8e2f7c54bfd442d19da63c94da9a50a867e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180444 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 409ba80bbf2c..03c8bbf997a8 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -32,6 +32,7 @@ #include <objidl.h> #include <osl/diagnose.h> #include <osl/thread.h> +#include <systools/win32/extended_max_path.hxx> #include <systools/win32/qswin32.h> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/windowserrorstring.hxx> @@ -753,8 +754,8 @@ static bool FileExistsW( LPCWSTR lpPath ) bool ShutdownIcon::IsQuickstarterInstalled() { - wchar_t aPath[_MAX_PATH]; - GetModuleFileNameW( nullptr, aPath, _MAX_PATH-1); + wchar_t aPath[EXTENDED_MAX_PATH]; + GetModuleFileNameW(nullptr, aPath, std::size(aPath)); OUString aOfficepath( o3tl::toU(aPath) ); int i = aOfficepath.lastIndexOf('\'); @@ -768,8 +769,8 @@ bool ShutdownIcon::IsQuickstarterInstalled() void ShutdownIcon::EnableAutostartW32( const OUString &aShortcut ) { - wchar_t aPath[_MAX_PATH]; - GetModuleFileNameW( nullptr, aPath, _MAX_PATH-1); + wchar_t aPath[EXTENDED_MAX_PATH]; + GetModuleFileNameW(nullptr, aPath, std::size(aPath)); OUString aOfficepath( o3tl::toU(aPath) ); int i = aOfficepath.lastIndexOf('\');