Kaydet (Commit) 59402cae authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#103525: a blind fix: try Unicode function first

Change-Id: If088efdcbf41807ac8fad2410953abb685c8ea01
Reviewed-on: https://gerrit.libreoffice.org/42274Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 5685ee25
......@@ -633,20 +633,20 @@ static bool GetSpecialFolder(rtl_uString **strPath, int nFolder)
pSHGetSpecialFolderPathA = reinterpret_cast<BOOL (WINAPI *)(HWND, LPSTR, int, BOOL)>(GetProcAddress(hLibrary, "SHGetSpecialFolderPathA"));
pSHGetSpecialFolderPathW = reinterpret_cast<BOOL (WINAPI *)(HWND, LPWSTR, int, BOOL)>(GetProcAddress(hLibrary, "SHGetSpecialFolderPathW"));
if (pSHGetSpecialFolderPathA)
if (pSHGetSpecialFolderPathW)
{
if (pSHGetSpecialFolderPathA(GetActiveWindow(), PathA, nFolder, TRUE))
if (pSHGetSpecialFolderPathW(GetActiveWindow(), SAL_W(PathW), nFolder, TRUE))
{
rtl_string2UString( strPath, PathA, (sal_Int32) strlen(PathA), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
OSL_ASSERT(*strPath != nullptr);
rtl_uString_newFromStr( strPath, PathW);
bRet = true;
}
}
else if (pSHGetSpecialFolderPathW)
else if (pSHGetSpecialFolderPathA)
{
if (pSHGetSpecialFolderPathW(GetActiveWindow(), SAL_W(PathW), nFolder, TRUE))
if (pSHGetSpecialFolderPathA(GetActiveWindow(), PathA, nFolder, TRUE))
{
rtl_uString_newFromStr( strPath, PathW);
rtl_string2UString( strPath, PathA, (sal_Int32) strlen(PathA), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
OSL_ASSERT(*strPath != nullptr);
bRet = true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment