[Libreoffice-commits] core.git: xmlsecurity/source

Stephan Bergmann sbergman at redhat.com
Thu May 11 09:17:53 UTC 2017


 xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx        |   10 +++--
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |   20 ++++------
 2 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit 4345cdb85a19fd311244d9cdaa45d82f45309c80
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 11 11:17:11 2017 +0200

    Clean up uses of SAL_U/SAL_W: xmlsecurity
    
    Change-Id: I96043623a5b0e26ddc44de5c71743f3b0d8e1e50

diff --git a/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx
index fbff7f04f588..de0eb3873f2a 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx
@@ -93,11 +93,14 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl:
                 }
             case CERT_ALT_NAME_RFC822_NAME :
                 arrCertAltNameEntry[i].Type = ExtAltNameType_RFC822_NAME;
-                arrCertAltNameEntry[i].Value <<= OUString(SAL_U(pEntry->pwszRfc822Name));
+                arrCertAltNameEntry[i].Value <<= OUString(
+                    reinterpret_cast<sal_Unicode const *>(
+                        pEntry->pwszRfc822Name));
                 break;
             case CERT_ALT_NAME_DNS_NAME :
                 arrCertAltNameEntry[i].Type = ExtAltNameType_DNS_NAME;
-                arrCertAltNameEntry[i].Value <<= OUString(SAL_U(pEntry->pwszDNSName));
+                arrCertAltNameEntry[i].Value <<= OUString(
+                    reinterpret_cast<sal_Unicode const *>(pEntry->pwszDNSName));
                 break;
             case CERT_ALT_NAME_DIRECTORY_NAME :
                 {
@@ -106,7 +109,8 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl:
                 }
             case CERT_ALT_NAME_URL :
                 arrCertAltNameEntry[i].Type = ExtAltNameType_URL;
-                arrCertAltNameEntry[i].Value <<= OUString(SAL_U(pEntry->pwszURL));
+                arrCertAltNameEntry[i].Value <<= OUString(
+                    reinterpret_cast<sal_Unicode const *>(pEntry->pwszURL));
                 break;
             case CERT_ALT_NAME_IP_ADDRESS :
                 {
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 721f9f32bbaa..55b732987d0f 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -282,22 +282,21 @@ void SecurityEnvironment_MSCryptImpl::setCertDb( HCERTSTORE aCertDb ) {
 
 // Based on sample code from MSDN
 
-static void get_system_name(const void *pvSystemStore,
-                            DWORD dwFlags,
-                            LPCWSTR *ppwszSystemName)
+static OUString get_system_name(const void *pvSystemStore,
+                            DWORD dwFlags)
 {
-    *ppwszSystemName = nullptr;
-
+    LPCWSTR ppwszSystemName;
     if (dwFlags & CERT_SYSTEM_STORE_RELOCATE_FLAG)
     {
         _CERT_SYSTEM_STORE_RELOCATE_PARA const * pRelocatePara;
         pRelocatePara = static_cast<_CERT_SYSTEM_STORE_RELOCATE_PARA const *>(pvSystemStore);
-        *ppwszSystemName = pRelocatePara->pwszSystemStore;
+        ppwszSystemName = pRelocatePara->pwszSystemStore;
     }
     else
     {
-        *ppwszSystemName = static_cast<LPCWSTR>(pvSystemStore);
+        ppwszSystemName = static_cast<LPCWSTR>(pvSystemStore);
     }
+    return reinterpret_cast<sal_Unicode const *>(ppwszSystemName);
 }
 
 extern "C" BOOL WINAPI cert_enum_physical_store_callback(const void *,
@@ -307,7 +306,7 @@ extern "C" BOOL WINAPI cert_enum_physical_store_callback(const void *,
                                                          void *,
                                                          void *)
 {
-    OUString name(SAL_U(pwszStoreName));
+    OUString name(reinterpret_cast<sal_Unicode const *>(pwszStoreName));
     if (dwFlags & CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG)
         name += " (implicitly created)";
     SAL_INFO("xmlsecurity.xmlsec", "  Physical store: " << name);
@@ -321,10 +320,7 @@ extern "C" BOOL WINAPI cert_enum_system_store_callback(const void *pvSystemStore
                                                        void *,
                                                        void *)
 {
-    LPCWSTR pwszSystemStore;
-
-    get_system_name(pvSystemStore, dwFlags, &pwszSystemStore);
-    SAL_INFO("xmlsecurity.xmlsec", "System store: " << OUString(SAL_U(pwszSystemStore)));
+    SAL_INFO("xmlsecurity.xmlsec", "System store: " << get_system_name(pvSystemStore, dwFlags));
 
     if (!CertEnumPhysicalStore(pvSystemStore,
                                dwFlags,


More information about the Libreoffice-commits mailing list