diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-04 14:57:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-04 16:12:11 +0000 |
commit | 9ac98e6e3488e434bf4864ecfb13a121784f640b (patch) | |
tree | b3c9cbf52126fee5864be12e9109f7413e7a0878 /extensions/source/config/ldap | |
parent | 6f995da5a652d993ab253b3363188cd18e289728 (diff) |
Finally switch MSVC to sal_Unicode = char16_t, too
There is lots of (Windows-only) code that relied on sal_Unicode being the same
as wchar_t, and the best change may be different in each case (and doing the
changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding
functions to sal/types.h, remove their uses one by one again, and finally drop
those functions again.
Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea
Reviewed-on: https://gerrit.libreoffice.org/36077
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'extensions/source/config/ldap')
-rw-r--r-- | extensions/source/config/ldap/ldapaccess.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index 87d686e39082..522c095026ab 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -132,8 +132,8 @@ void LdapConnection::connectSimple() // Do the bind #ifdef _WIN32 LdapErrCode retCode = ldap_simple_bind_sW(mConnection, - const_cast<sal_Unicode *>(mLdapDefinition.mAnonUser.getStr()), - const_cast<sal_Unicode *>(mLdapDefinition.mAnonCredentials.getStr()) ); + SAL_W(const_cast<sal_Unicode *>(mLdapDefinition.mAnonUser.getStr())), + SAL_W(const_cast<sal_Unicode *>(mLdapDefinition.mAnonCredentials.getStr())) ); #else LdapErrCode retCode = ldap_simple_bind_s(mConnection, OUStringToOString( mLdapDefinition.mAnonUser, RTL_TEXTENCODING_UTF8 ).getStr(), @@ -154,7 +154,7 @@ void LdapConnection::initConnection() if (mLdapDefinition.mPort == 0) mLdapDefinition.mPort = LDAP_PORT; #ifdef _WIN32 - mConnection = ldap_initW(const_cast<sal_Unicode *>(mLdapDefinition.mServer.getStr()), + mConnection = ldap_initW(SAL_W(const_cast<sal_Unicode *>(mLdapDefinition.mServer.getStr())), mLdapDefinition.mPort) ; #else mConnection = ldap_init(OUStringToOString( mLdapDefinition.mServer, RTL_TEXTENCODING_UTF8 ).getStr(), @@ -179,7 +179,7 @@ void LdapConnection::initConnection() LdapMessageHolder result; #ifdef _WIN32 LdapErrCode retCode = ldap_search_sW(mConnection, - const_cast<sal_Unicode *>(aUserDn.getStr()), + SAL_W(const_cast<sal_Unicode *>(aUserDn.getStr())), LDAP_SCOPE_BASE, const_cast<PWCHAR>( L"(objectclass=*)" ), nullptr, @@ -246,9 +246,9 @@ void LdapConnection::initConnection() #ifdef _WIN32 PWCHAR attributes [2] = { const_cast<PWCHAR>( L"1.1" ), nullptr }; LdapErrCode retCode = ldap_search_sW(mConnection, - const_cast<sal_Unicode *>(mLdapDefinition.mBaseDN.getStr()), + SAL_W(const_cast<sal_Unicode *>(mLdapDefinition.mBaseDN.getStr())), LDAP_SCOPE_SUBTREE, - const_cast<sal_Unicode *>(filter.makeStringAndClear().getStr()), attributes, 0, &result.msg) ; + SAL_W(const_cast<sal_Unicode *>(filter.makeStringAndClear().getStr())), attributes, 0, &result.msg) ; #else sal_Char * attributes [2] = { const_cast<sal_Char *>(LDAP_NO_ATTRS), nullptr }; LdapErrCode retCode = ldap_search_s(mConnection, |