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

Stephan Bergmann sbergman at redhat.com
Sun Mar 29 13:27:34 PDT 2015


 shell/source/backends/localebe/localebackend.cxx |    6 +++---
 shell/source/backends/macbe/macbackend.mm        |   16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 9e53fbd9a67bbfc35aa6b96dc034df9f6ecf5643
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Mar 29 21:36:54 2015 +0200

    loplugin:cstylecast
    
    Change-Id: I8bb20f4ce9c8cca3b70057cd8c4fb23819fa3b23

diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx
index 1a8da7b..f2190d1 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -106,7 +106,7 @@ namespace /* private */
         if (ref == NULL)
             return NULL;
 
-        CFStringRef sref = (CFGetTypeID(ref) == CFArrayGetTypeID()) ? (CFStringRef)CFArrayGetValueAtIndex((CFArrayRef)ref, 0) : (CFStringRef)ref;
+        CFStringRef sref = (CFGetTypeID(ref) == CFArrayGetTypeID()) ? static_cast<CFStringRef>(CFArrayGetValueAtIndex(static_cast<CFArrayRef>(ref), 0)) : static_cast<CFStringRef>(ref);
 
         // NOTE: this API is only available with Mac OS X >=10.3. We need to use it because
         // Apple used non-ISO values on systems <10.2 like "German" for instance but didn't
@@ -133,7 +133,7 @@ namespace /* private */
             {
                 aLocaleBuffer.setLength(0); // clear buffer which still contains fallback value
 
-                CFStringRef lang = (CFStringRef)CFArrayGetValueAtIndex(subs, 0);
+                CFStringRef lang = static_cast<CFStringRef>(CFArrayGetValueAtIndex(subs, 0));
                 OUStringBufferAppendCFString(aLocaleBuffer, lang);
 
                 // country also available? Assumption: if the array contains more than one
@@ -141,7 +141,7 @@ namespace /* private */
                 if (CFArrayGetCount(subs) > 1)
                 {
                     aLocaleBuffer.appendAscii("-");
-                    CFStringRef country = (CFStringRef)CFArrayGetValueAtIndex(subs, 1);
+                    CFStringRef country = static_cast<CFStringRef>(CFArrayGetValueAtIndex(subs, 1));
                     OUStringBufferAppendCFString(aLocaleBuffer, country);
                 }
             }
diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm
index cd14665..57b0a21 100644
--- a/shell/source/backends/macbe/macbackend.mm
+++ b/shell/source/backends/macbe/macbackend.mm
@@ -97,8 +97,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
             break;
     }
     // Proxy enabled?
-    enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
-                                                   proxiesEnable );
+    enableNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict,
+                                                   proxiesEnable ));
 
     result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
 
@@ -108,8 +108,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
     // Proxy enabled -> get hostname
     if (result)
     {
-        hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict,
-                                                     proxiesProxy );
+        hostStr = static_cast<CFStringRef>(CFDictionaryGetValue( proxyDict,
+                                                     proxiesProxy ));
 
         result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
     }
@@ -120,8 +120,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
     // Get proxy port
     if (result)
     {
-        portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
-                                                     proxiesPort );
+        portNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict,
+                                                     proxiesPort ));
 
         result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
     }
@@ -401,13 +401,13 @@ css::uno::Any MacOSXBackend::getPropertyValue(
         if (!rProxyDict)
             rExceptionsList = 0;
         else
-            rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList);
+            rExceptionsList = static_cast<CFArrayRef>(CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList));
 
         if (rExceptionsList)
         {
             for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++)
             {
-                CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
+                CFStringRef rException = static_cast<CFStringRef>(CFArrayGetValueAtIndex(rExceptionsList, idx));
 
                 if (idx>0)
                     aProxyBypassList += rtl::OUString(";");


More information about the Libreoffice-commits mailing list