diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-14 13:46:30 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-14 14:47:03 +0200 |
commit | 59402caefa12b922f2d0e2083e420a02356ea476 (patch) | |
tree | 1a5ba64f49271b5aa780532428df528e2bb8c9bb /sal | |
parent | 5685ee25aad4a4debb47fb5896082be48f521d17 (diff) |
tdf#103525: a blind fix: try Unicode function first
Change-Id: If088efdcbf41807ac8fad2410953abb685c8ea01
Reviewed-on: https://gerrit.libreoffice.org/42274
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/security.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sal/osl/w32/security.cxx b/sal/osl/w32/security.cxx index 890a018a6515..fcec4d20f1f3 100644 --- a/sal/osl/w32/security.cxx +++ b/sal/osl/w32/security.cxx @@ -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; } } |