summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-26 11:28:57 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-30 11:23:41 +0200
commit362a21d3a129b90149f6ef645c127f5e86e0ba61 (patch)
tree8583cb29b33de56e4489cb8950d2714a1fb2957e /tools
parent81ce629c9e8a4fc26ded9d49157e3f3263991e03 (diff)
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 <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/stream/strmwnt.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index 3c629b1b9cba..c0c5373573e2 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -276,7 +276,6 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode )
m_eStreamMode &= ~StreamMode::TRUNC; // don't truncate on reopen
aFilename = aParsedFilename;
- OString aFileNameA(OUStringToOString(aFilename, osl_getThreadTextEncoding()));
SetLastError( ERROR_SUCCESS ); // might be changed by Redirector
DWORD nOpenAction;
@@ -317,8 +316,8 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode )
nOpenAction = OPEN_EXISTING;
}
- pInstanceData->hFile = CreateFile(
- aFileNameA.getStr(),
+ pInstanceData->hFile = CreateFileW(
+ SAL_W(aFilename.getStr()),
nAccessMode,
nShareMode,
nullptr,
@@ -351,8 +350,8 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode )
// if Openaction is CREATE_ALWAYS
nOpenAction = OPEN_EXISTING;
SetLastError( ERROR_SUCCESS );
- pInstanceData->hFile = CreateFile(
- aFileNameA.getStr(),
+ pInstanceData->hFile = CreateFileW(
+ SAL_W(aFilename.getStr()),
GENERIC_READ,
nShareMode,
nullptr,