diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:19:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:20:38 +0100 |
commit | b6f6cf85abaf93ac99683aefbc81e981c5b14e22 (patch) | |
tree | a3fc82563ad7178c91fcafc8912deba6dc1c108b /shell | |
parent | b6f1be102c18d75099b5fdd96f5a1a2b6a271142 (diff) |
loplugin:nullptr (automatic rewrite; Mac-specific code)
Change-Id: Iaa14c583c55c3582e33a1d073ea92b388cd6f3a4
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/backends/localebe/localebackend.cxx | 12 | ||||
-rw-r--r-- | shell/source/backends/macbe/macbackend.mm | 12 | ||||
-rw-r--r-- | shell/source/backends/macbe/macbecdef.cxx | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 66acbc3e7698..a9014050c5d0 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -97,14 +97,14 @@ namespace /* private */ CFStringRef ImplGetAppPreference(const char* pref) { - CFStringRef csPref = CFStringCreateWithCString(NULL, pref, kCFStringEncodingASCII); + CFStringRef csPref = CFStringCreateWithCString(nullptr, pref, kCFStringEncodingASCII); CFStringGuard csRefGuard(csPref); CFTypeRef ref = CFPreferencesCopyAppValue(csPref, kCFPreferencesCurrentApplication); CFTypeRefGuard refGuard(ref); - if (ref == NULL) - return NULL; + if (ref == nullptr) + return nullptr; CFStringRef sref = (CFGetTypeID(ref) == CFArrayGetTypeID()) ? static_cast<CFStringRef>(CFArrayGetValueAtIndex(static_cast<CFArrayRef>(ref), 0)) : static_cast<CFStringRef>(ref); @@ -122,14 +122,14 @@ namespace /* private */ OUStringBuffer aLocaleBuffer; aLocaleBuffer.append("en-US"); // initialize with fallback value - if (sref != NULL) + if (sref != nullptr) { // split the string into substrings; the first two (if there are two) substrings // are language and country - CFArrayRef subs = CFStringCreateArrayBySeparatingStrings(NULL, sref, CFSTR("_")); + CFArrayRef subs = CFStringCreateArrayBySeparatingStrings(nullptr, sref, CFSTR("_")); CFArrayGuard subsGuard(subs); - if (subs != NULL) + if (subs != nullptr) { aLocaleBuffer.setLength(0); // clear buffer which still contains fallback value diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm index 2b0acf559f03..6832d6638213 100644 --- a/shell/source/backends/macbe/macbackend.mm +++ b/shell/source/backends/macbe/macbackend.mm @@ -72,7 +72,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por CFNumberRef portNum; int portInt; - proxyDict = SCDynamicStoreCopyProxies(NULL); + proxyDict = SCDynamicStoreCopyProxies(nullptr); if (!proxyDict) return false; @@ -100,7 +100,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por enableNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict, proxiesEnable )); - result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID()); + result = (enableNum != nullptr) && (CFGetTypeID(enableNum) == CFNumberGetTypeID()); if (result) result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0); @@ -111,7 +111,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por hostStr = static_cast<CFStringRef>(CFDictionaryGetValue( proxyDict, proxiesProxy )); - result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID()); + result = (hostStr != nullptr) && (CFGetTypeID(hostStr) == CFStringGetTypeID()); } if (result) @@ -123,7 +123,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por portNum = static_cast<CFNumberRef>(CFDictionaryGetValue( proxyDict, proxiesPort )); - result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID()); + result = (portNum != nullptr) && (CFGetTypeID(portNum) == CFNumberGetTypeID()); } else { @@ -396,10 +396,10 @@ css::uno::Any MacOSXBackend::getPropertyValue( rtl::OUString aProxyBypassList; CFArrayRef rExceptionsList; - CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL); + CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(nullptr); if (!rProxyDict) - rExceptionsList = 0; + rExceptionsList = nullptr; else rExceptionsList = static_cast<CFArrayRef>(CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList)); diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx index 919441443ebf..8073f69c037e 100644 --- a/shell/source/backends/macbe/macbecdef.cxx +++ b/shell/source/backends/macbe/macbecdef.cxx @@ -43,10 +43,10 @@ static const cppu::ImplementationEntry kImplementations_entries[] = MacOSXBackend::getBackendName, MacOSXBackend::getBackendServiceNames, cppu::createSingleComponentFactory, - NULL, + nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; |