Kaydet (Commit) 9e53fbd9 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast

Change-Id: I8bb20f4ce9c8cca3b70057cd8c4fb23819fa3b23
üst da1d01a4
...@@ -106,7 +106,7 @@ namespace /* private */ ...@@ -106,7 +106,7 @@ namespace /* private */
if (ref == NULL) if (ref == NULL)
return 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 // 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 // Apple used non-ISO values on systems <10.2 like "German" for instance but didn't
...@@ -133,7 +133,7 @@ namespace /* private */ ...@@ -133,7 +133,7 @@ namespace /* private */
{ {
aLocaleBuffer.setLength(0); // clear buffer which still contains fallback value 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); OUStringBufferAppendCFString(aLocaleBuffer, lang);
// country also available? Assumption: if the array contains more than one // country also available? Assumption: if the array contains more than one
...@@ -141,7 +141,7 @@ namespace /* private */ ...@@ -141,7 +141,7 @@ namespace /* private */
if (CFArrayGetCount(subs) > 1) if (CFArrayGetCount(subs) > 1)
{ {
aLocaleBuffer.appendAscii("-"); aLocaleBuffer.appendAscii("-");
CFStringRef country = (CFStringRef)CFArrayGetValueAtIndex(subs, 1); CFStringRef country = static_cast<CFStringRef>(CFArrayGetValueAtIndex(subs, 1));
OUStringBufferAppendCFString(aLocaleBuffer, country); OUStringBufferAppendCFString(aLocaleBuffer, country);
} }
} }
......
...@@ -97,8 +97,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -97,8 +97,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
break; break;
} }
// Proxy enabled? // Proxy enabled?
enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict, enableNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict,
proxiesEnable ); proxiesEnable ));
result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID()); result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
...@@ -108,8 +108,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -108,8 +108,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
// Proxy enabled -> get hostname // Proxy enabled -> get hostname
if (result) if (result)
{ {
hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict, hostStr = static_cast<CFStringRef>(CFDictionaryGetValue( proxyDict,
proxiesProxy ); proxiesProxy ));
result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID()); result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
} }
...@@ -120,8 +120,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por ...@@ -120,8 +120,8 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por
// Get proxy port // Get proxy port
if (result) if (result)
{ {
portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict, portNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict,
proxiesPort ); proxiesPort ));
result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID()); result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
} }
...@@ -401,13 +401,13 @@ css::uno::Any MacOSXBackend::getPropertyValue( ...@@ -401,13 +401,13 @@ css::uno::Any MacOSXBackend::getPropertyValue(
if (!rProxyDict) if (!rProxyDict)
rExceptionsList = 0; rExceptionsList = 0;
else else
rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList); rExceptionsList = static_cast<CFArrayRef>(CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList));
if (rExceptionsList) if (rExceptionsList)
{ {
for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++) 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) if (idx>0)
aProxyBypassList += rtl::OUString(";"); aProxyBypassList += rtl::OUString(";");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment