From 1944e3ddc0b2247de3138d2a441cd6999e21fd9a Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 5 Oct 2017 06:19:56 +0300 Subject: Rename and move SAL_U/W to o3tl::toU/W Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- shell/source/backends/localebe/localebackend.cxx | 3 ++- shell/source/win32/SysShExec.cxx | 5 +++-- shell/source/win32/simplemail/smplmailclient.cxx | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 0b896a3fadc6..7ff388a1f26d 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -54,7 +55,7 @@ css::beans::Optional ImplGetLocale(LCID lcid) // #i50822# minus character must be written before cp *(cp - 1) = '-'; - return {true, css::uno::Any(OUString(SAL_U(buffer)))}; + return {true, css::uno::Any(OUString(o3tl::toU(buffer)))}; } return {false, {}}; diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 3b569ed7c7c1..55b20e62fc46 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #define WIN32_LEAN_AND_MEAN #if defined _MSC_VER @@ -297,8 +298,8 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa ZeroMemory(&sei, sizeof( sei)); sei.cbSize = sizeof(sei); - sei.lpFile = SAL_W(preprocessed_command.getStr()); - sei.lpParameters = SAL_W(aParameter.getStr()); + sei.lpFile = o3tl::toW(preprocessed_command.getStr()); + sei.lpParameters = o3tl::toW(aParameter.getStr()); sei.nShow = SW_SHOWNORMAL; if (NO_SYSTEM_ERROR_MESSAGE & nFlags) diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 16ef55b6230d..b38061c37037 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #define WIN32_LEAN_AND_MEAN #if defined _MSC_VER @@ -81,7 +82,7 @@ namespace /* private */ lret = RegQueryValueW(hkey, nullptr, buff, &sz); if (lret == ERROR_SUCCESS) { - osl::FileBase::getFileURLFromSystemPath(SAL_U(buff), altSenddocUrl); + osl::FileBase::getFileURLFromSystemPath(o3tl::toU(buff), altSenddocUrl); } RegCloseKey(hkey); } -- cgit