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 /desktop/source/app | |
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 'desktop/source/app')
-rw-r--r-- | desktop/source/app/app.cxx | 6 | ||||
-rw-r--r-- | desktop/source/app/cmdlinehelp.cxx | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index b08e928dd32c..7c194f890db9 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2633,12 +2633,12 @@ void Desktop::CheckFirstRun( ) #ifdef _WIN32 // Check if Quickstarter should be started (on Windows only) - TCHAR szValue[8192]; + WCHAR szValue[8192]; DWORD nValueSize = sizeof(szValue); HKEY hKey; - if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, "Software\\LibreOffice", &hKey ) ) + if ( ERROR_SUCCESS == RegOpenKeyW( HKEY_LOCAL_MACHINE, L"Software\\LibreOffice", &hKey ) ) { - if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("RunQuickstartAtFirstStart"), nullptr, nullptr, reinterpret_cast<LPBYTE>(szValue), &nValueSize ) ) + if ( ERROR_SUCCESS == RegQueryValueExW( hKey, L"RunQuickstartAtFirstStart", nullptr, nullptr, reinterpret_cast<LPBYTE>(szValue), &nValueSize ) ) { css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); css::office::Quickstart::createAutoStart(xContext, true/*Quickstart*/, true/*bAutostart*/); diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index a4b3114cf3bb..43028a72fd10 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -187,9 +187,9 @@ namespace desktop { if (GetStdHandle(STD_OUTPUT_HANDLE) == nullptr) // application does not have associated standard handles { - STARTUPINFOA aStartupInfo; + STARTUPINFOW aStartupInfo; aStartupInfo.cb = sizeof(aStartupInfo); - GetStartupInfoA(&aStartupInfo); + GetStartupInfoW(&aStartupInfo); if ((aStartupInfo.dwFlags & STARTF_USESTDHANDLES) == STARTF_USESTDHANDLES) { // If standard handles had been passed to this process, use them @@ -247,11 +247,11 @@ namespace desktop ke.bKeyDown = TRUE; ke.wRepeatCount = 1; ke.wVirtualKeyCode = VK_RETURN; - ke.wVirtualScanCode = MapVirtualKeyA(VK_RETURN, MAPVK_VK_TO_VSC); - ke.uChar.AsciiChar = '\r'; + ke.wVirtualScanCode = MapVirtualKeyW(VK_RETURN, MAPVK_VK_TO_VSC); + ke.uChar.UnicodeChar = L'\r'; ke.dwControlKeyState = 0; DWORD nEvents; - WriteConsoleInputA(GetStdHandle(STD_INPUT_HANDLE), &ir, 1, &nEvents); + WriteConsoleInputW(GetStdHandle(STD_INPUT_HANDLE), &ir, 1, &nEvents); break; } case allocated: |