summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-10-05 06:19:56 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-10-05 16:02:52 +0200
commit1944e3ddc0b2247de3138d2a441cd6999e21fd9a (patch)
treeb59f213e245e151ee792ca424fd06b5a11c88857 /dbaccess
parent81d404803f477eb71b74eb9c7a67bba6b1af95d1 (diff)
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 <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/adodatalinks.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx
index 3b1e552f6db0..ef4bc2601b36 100644
--- a/dbaccess/source/ui/dlg/adodatalinks.cxx
+++ b/dbaccess/source/ui/dlg/adodatalinks.cxx
@@ -31,6 +31,8 @@
#pragma warning(push, 1)
#endif
+#include <o3tl/char16_t2wchar_t.hxx>
+
#include <initguid.h>
#include <adoid.h>
#include <adoint.h>
@@ -89,7 +91,8 @@ OUString PromptNew(long hWnd)
piTmpConnection->Release( );
dlPrompt->Release( );
CoUninitialize();
- return SAL_U(_result);
+ // Don't we need SysFreeString(_result)?
+ return o3tl::toU(_result);
}
OUString PromptEdit(long hWnd, OUString const & connstr)
@@ -115,7 +118,7 @@ OUString PromptEdit(long hWnd, OUString const & connstr)
hr = piTmpConnection->put_ConnectionString(
- const_cast<BSTR>(SAL_W(connstr.getStr())));
+ const_cast<BSTR>(o3tl::toW(connstr.getStr())));
if( FAILED( hr ) )
{
piTmpConnection->Release( );
@@ -180,7 +183,8 @@ OUString PromptEdit(long hWnd, OUString const & connstr)
piTmpConnection->Release( );
dlPrompt->Release( );
CoUninitialize();
- return SAL_U(_result);
+ // Don't we need SysFreeString(_result)?
+ return o3tl::toU(_result);
}
}