From 362a21d3a129b90149f6ef645c127f5e86e0ba61 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 26 Sep 2017 11:28:57 +0300 Subject: Use explicit function names for fooA/fooW WinAPI; prefer fooW We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- basic/source/runtime/methods.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'basic') diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 8a0ae5d2ff36..cef5dd269a3a 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2958,8 +2958,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) OUString aPathURL = getFullPath( rPar.Get(1)->GetOUString() ); OUString aPath; FileBase::getSystemPathFromFileURL( aPathURL, aPath ); - OString aSystemPath(OUStringToOString(aPath, osl_getThreadTextEncoding())); - DWORD nRealFlags = GetFileAttributes (aSystemPath.getStr()); + DWORD nRealFlags = GetFileAttributesW (SAL_W(aPath.getStr())); if (nRealFlags != 0xffffffff) { if (nRealFlags == FILE_ATTRIBUTE_NORMAL) -- cgit