diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:23:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:39 +0100 |
commit | 7a8d48f57d106005be80e37ac74e8e2544ad83fe (patch) | |
tree | 4fe46b96ce47ff3bced1e9a6bf17cff87081b179 /shell | |
parent | 28034eaf925aa50d379dd5cffccc20d7edc95aec (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: Ied61699170bd5d2c3878135b1a43b4dc1deff4d4
Diffstat (limited to 'shell')
-rw-r--r-- | shell/inc/internal/xml_parser.hxx | 2 | ||||
-rw-r--r-- | shell/source/all/xml_parser.cxx | 4 | ||||
-rw-r--r-- | shell/source/backends/desktopbe/desktopbackend.cxx | 4 | ||||
-rw-r--r-- | shell/source/backends/kde4be/kde4backend.cxx | 6 | ||||
-rw-r--r-- | shell/source/backends/localebe/localebackend.cxx | 6 | ||||
-rw-r--r-- | shell/source/backends/localebe/localebecdef.cxx | 4 | ||||
-rw-r--r-- | shell/source/cmdmail/cmdmailsuppl.cxx | 2 | ||||
-rw-r--r-- | shell/source/sessioninstall/SyncDbusSessionHelper.cxx | 12 | ||||
-rw-r--r-- | shell/source/tools/lngconvex/lngconvex.cxx | 4 | ||||
-rw-r--r-- | shell/source/unix/exec/shellexec.cxx | 6 | ||||
-rw-r--r-- | shell/source/unix/sysshell/recently_used_file.cxx | 6 | ||||
-rw-r--r-- | shell/source/unix/sysshell/recently_used_file_handler.cxx | 12 |
12 files changed, 34 insertions, 34 deletions
diff --git a/shell/inc/internal/xml_parser.hxx b/shell/inc/internal/xml_parser.hxx index a24d6bf3b65f..975f17afaddc 100644 --- a/shell/inc/internal/xml_parser.hxx +++ b/shell/inc/internal/xml_parser.hxx @@ -58,7 +58,7 @@ class i_xml_parser_event_handler; class xml_parser { public: - xml_parser(const XML_Char* EncodingName = 0); + xml_parser(const XML_Char* EncodingName = nullptr); ~xml_parser(); diff --git a/shell/source/all/xml_parser.cxx b/shell/source/all/xml_parser.cxx index 3c9669aaaae6..893cf0870f03 100644 --- a/shell/source/all/xml_parser.cxx +++ b/shell/source/all/xml_parser.cxx @@ -70,7 +70,7 @@ namespace /* private */ } xml_parser::xml_parser(const XML_Char* EncodingName) : - document_handler_(0), + document_handler_(nullptr), xml_parser_(XML_ParserCreate(EncodingName)) { init(); @@ -89,7 +89,7 @@ extern "C" static void xml_start_element_handler(void* UserData, const XML_Char* name, const XML_Char** atts) { - assert(UserData != NULL); + assert(UserData != nullptr); xml_parser* pImpl = get_parser_instance(UserData); diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index d8527f906da5..dc98f455b036 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -228,9 +228,9 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( static cppu::ImplementationEntry const services[] = { { &createInstance, &getDefaultImplementationName, - &getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, 0, + &getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx index 5577fdc74c72..fadd5ae43cdb 100644 --- a/shell/source/backends/kde4be/kde4backend.cxx +++ b/shell/source/backends/kde4be/kde4backend.cxx @@ -146,7 +146,7 @@ Service::Service(): enabled_(false) { if (context.is()) { OUString desktop; context->getValueByName("system.desktop-environment") >>= desktop; - enabled_ = desktop == "KDE4" && KApplication::kApplication() != 0; + enabled_ = desktop == "KDE4" && KApplication::kApplication() != nullptr; } } @@ -192,9 +192,9 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( static cppu::ImplementationEntry const services[] = { { &createInstance, &getServiceImplementationName, - &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0, + &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index ac9716731162..66acbc3e7698 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -168,12 +168,12 @@ static OUString ImplGetLocale(int category) const char *locale = setlocale(category, ""); // Return "en-US" for C locales - if( (locale == NULL) || ( locale[0] == 'C' && locale[1] == '\0' ) ) + if( (locale == nullptr) || ( locale[0] == 'C' && locale[1] == '\0' ) ) return OUString( "en-US" ); const char *cp; - const char *uscore = NULL; + const char *uscore = nullptr; // locale string have the format lang[_ctry][.encoding][@modifier] // we are only interested in the first two items, so we handle @@ -187,7 +187,7 @@ static OUString ImplGetLocale(int category) } OUStringBuffer aLocaleBuffer; - if( uscore != NULL ) + if( uscore != nullptr ) { aLocaleBuffer.appendAscii(locale, uscore++ - locale); aLocaleBuffer.append("-"); diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx index 22549779c02a..6d79a0101e2e 100644 --- a/shell/source/backends/localebe/localebecdef.cxx +++ b/shell/source/backends/localebe/localebecdef.cxx @@ -42,10 +42,10 @@ static const cppu::ImplementationEntry kImplementations_entries[] = LocaleBackend::getBackendName, LocaleBackend::getBackendServiceNames, cppu::createSingleComponentFactory, - NULL, + nullptr, 0 }, - { NULL, NULL, NULL, NULL, NULL, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } } ; diff --git a/shell/source/cmdmail/cmdmailsuppl.cxx b/shell/source/cmdmail/cmdmailsuppl.cxx index 56019e76b3e6..be09ff776e38 100644 --- a/shell/source/cmdmail/cmdmailsuppl.cxx +++ b/shell/source/cmdmail/cmdmailsuppl.cxx @@ -296,7 +296,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM OString cmd = aBuffer.makeStringAndClear(); FILE * f = popen(cmd.getStr(), "w"); - if (f == 0 || pclose(f) != 0) + if (f == nullptr || pclose(f) != 0) { throw css::uno::Exception("No mail client configured", static_cast < XSimpleMailClient * > (this) ); diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index e807254e8c8b..d0c1b30a47ed 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -39,14 +39,14 @@ namespace static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface) { const OString sFullInterface = OUStringToOString("org.freedesktop.PackageKit." + sInterface, RTL_TEXTENCODING_ASCII_US); - GErrorWrapper error(NULL); - GDBusProxy* proxy = NULL; + GErrorWrapper error(nullptr); + GDBusProxy* proxy = nullptr; proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, - G_DBUS_PROXY_FLAGS_NONE, NULL, + G_DBUS_PROXY_FLAGS_NONE, nullptr, "org.freedesktop.PackageKit", "/org/freedesktop/PackageKit", reinterpret_cast<const gchar*>(sFullInterface.getStr()), - NULL, + nullptr, &error.getRef()); if(!proxy) throw RuntimeException("couldnt get a proxy!"); @@ -166,7 +166,7 @@ void SyncDbusSessionHelper::InstallPrinterDrivers( const OString sPackagenameAscii = OUStringToOString(sPackagename, RTL_TEXTENCODING_ASCII_US); const OString sInteractionAscii = OUStringToOString(sInteraction, RTL_TEXTENCODING_ASCII_US); std::shared_ptr<GDBusProxy> proxy(lcl_GetPackageKitProxy("Query"), GObjectDeleter<GDBusProxy>()); - GErrorWrapper error(NULL); + GErrorWrapper error(nullptr); std::shared_ptr<GVariant> result(g_dbus_proxy_call_sync (proxy.get(), "IsInstalled", g_variant_new ("(ss)", @@ -174,7 +174,7 @@ void SyncDbusSessionHelper::InstallPrinterDrivers( sInteractionAscii.getStr()), G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ - NULL, /* cancellable */ + nullptr, /* cancellable */ &error.getRef()),GVariantDeleter()); if(result.get()) o_isInstalled = bool(g_variant_get_boolean(g_variant_get_child_value(result.get(),0))); diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index 8f4b3f9d6aec..395a283e29e9 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -262,7 +262,7 @@ private: iso_lang_replacement_table_t::iterator iter = iso_lang_replacement_table_.find(iso_lang); - replacement_table_t* prt = NULL; + replacement_table_t* prt = nullptr; if (iso_lang_replacement_table_.end() == iter) { @@ -330,7 +330,7 @@ void read_ulf_file(const std::string& FileName, Substitutor& Substitutor) // UTF8 files starting with a byte-order-mark we create a copy of the // original file without the byte-order-mark OUString tmpfile_url; - osl_createTempFile(NULL, NULL, &tmpfile_url.pData); + osl_createTempFile(nullptr, nullptr, &tmpfile_url.pData); OUString tmpfile_sys; osl::FileBase::getSystemPathFromFileURL(tmpfile_url, tmpfile_sys); diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 127acd85b527..99ed3a7a2f45 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -231,13 +231,13 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar if ( !aLaunchBuffer.isEmpty() ) { FILE *pLaunch = popen( aLaunchBuffer.makeStringAndClear().getStr(), "w" ); - if ( pLaunch != NULL ) + if ( pLaunch != nullptr ) { if ( 0 == pclose( pLaunch ) ) return; } // Failed, do not try DESKTOP_LAUNCH any more - pDesktopLaunch = NULL; + pDesktopLaunch = nullptr; } OString cmd = @@ -248,7 +248,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar aBuffer.makeStringAndClear(); #endif FILE *pLaunch = popen(cmd.getStr(), "w"); - if ( pLaunch != NULL ) + if ( pLaunch != nullptr ) { if ( 0 == pclose( pLaunch ) ) return; diff --git a/shell/source/unix/sysshell/recently_used_file.cxx b/shell/source/unix/sysshell/recently_used_file.cxx index 16b0a373ad1b..86092f99ee86 100644 --- a/shell/source/unix/sysshell/recently_used_file.cxx +++ b/shell/source/unix/sysshell/recently_used_file.cxx @@ -46,7 +46,7 @@ inline void ensure_final_slash(/*inout*/ OUString& path) recently_used_file::recently_used_file() : - file_(NULL) + file_(nullptr) { osl::Security sec; OUString homedir_url; @@ -66,12 +66,12 @@ recently_used_file::recently_used_file() : int fd = open(tmp.getStr(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); if (fd != -1) { file_ = fdopen(fd, "w+"); - if (file_ == 0) { + if (file_ == nullptr) { close(fd); } } - if (NULL == file_) + if (nullptr == file_) throw "I/O error opening ~/.recently-used"; if (lockf(fileno(file_), F_LOCK, 0) != 0) diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx index 5f36496a2480..81b96960fac5 100644 --- a/shell/source/unix/sysshell/recently_used_file_handler.cxx +++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx @@ -80,7 +80,7 @@ namespace /* private */ { is_private_(is_private), groups_(groups) { - timestamp_ = time(NULL); + timestamp_ = time(nullptr); } void set_uri(const string_t& character) @@ -216,7 +216,7 @@ namespace /* private */ { { public: explicit recently_used_file_filter(recently_used_item_list_t& item_list) : - item_(NULL), + item_(nullptr), item_list_(item_list) { named_command_map_[TAG_RECENT_FILES] = &recently_used_item::set_nothing; @@ -234,14 +234,14 @@ namespace /* private */ { const string_t& local_name, const xml_tag_attribute_container_t& /*attributes*/) override { - if ((local_name == TAG_RECENT_ITEM) && (NULL == item_)) + if ((local_name == TAG_RECENT_ITEM) && (nullptr == item_)) item_ = new recently_used_item; } virtual void end_element(const string_t& /*raw_name*/, const string_t& local_name) override { // check for end tags w/o start tag - if( local_name != TAG_RECENT_FILES && NULL == item_ ) + if( local_name != TAG_RECENT_FILES && nullptr == item_ ) return; // will result in an XML parser error anyway if (named_command_map_.find(local_name) != named_command_map_.end()) @@ -255,7 +255,7 @@ namespace /* private */ { if (local_name == TAG_RECENT_ITEM) { item_list_.push_back(item_); - item_ = NULL; + item_ = nullptr; } current_element_.clear(); } @@ -406,7 +406,7 @@ namespace /* private */ { if (iter != item_list.end()) { - (*iter)->timestamp_ = time(NULL); + (*iter)->timestamp_ = time(nullptr); if (!(*iter)->has_group(GROUP_OOO)) (*iter)->groups_.push_back(GROUP_OOO); |