diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-26 11:28:57 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-30 11:23:41 +0200 |
commit | 362a21d3a129b90149f6ef645c127f5e86e0ba61 (patch) | |
tree | 8583cb29b33de56e4489cb8950d2714a1fb2957e /jvmfwk/source | |
parent | 81ce629c9e8a4fc26ded9d49157e3f3263991e03 (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 'jvmfwk/source')
-rw-r--r-- | jvmfwk/source/fwkutil.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx index fbb885b1d0c2..95fa21503bc0 100644 --- a/jvmfwk/source/fwkutil.cxx +++ b/jvmfwk/source/fwkutil.cxx @@ -66,18 +66,19 @@ bool isAccessibilitySupportDesired() #ifdef _WIN32 bool retVal = false; HKEY hKey = nullptr; - if (RegOpenKeyEx(HKEY_CURRENT_USER, - "Software\\LibreOffice\\Accessibility\\AtToolSupport", - 0, KEY_READ, &hKey) == ERROR_SUCCESS) + if (RegOpenKeyExA(HKEY_CURRENT_USER, + "Software\\LibreOffice\\Accessibility\\AtToolSupport", + 0, KEY_READ, &hKey) == ERROR_SUCCESS) { DWORD dwType = 0; DWORD dwLen = 16; unsigned char arData[16]; - if( RegQueryValueEx(hKey, "SupportAssistiveTechnology", nullptr, &dwType, arData, - & dwLen)== ERROR_SUCCESS) + if( RegQueryValueExA(hKey, "SupportAssistiveTechnology", nullptr, &dwType, arData, + &dwLen)== ERROR_SUCCESS) { if (dwType == REG_SZ) { + arData[std::min(dwLen, DWORD(15))] = 0; if (strcmp(reinterpret_cast<char*>(arData), "true") == 0 || strcmp(reinterpret_cast<char*>(arData), "1") == 0) retVal = true; @@ -98,9 +99,8 @@ bool isAccessibilitySupportDesired() "jfw", "bad registry value " << unsigned(arData[0])); } } + RegCloseKey(hKey); } - RegCloseKey(hKey); - #elif defined UNX // Java is no longer required for a11y - we use atk directly. bool retVal = ::rtl::Bootstrap::get( "JFW_PLUGIN_FORCE_ACCESSIBILITY", sValue) && sValue == "1"; |