From f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 12:46:15 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-nullptr=20pa?= =?UTF-8?q?ss.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer. --- src/extension/internal/svg.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/extension/internal/svg.cpp') diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index c4e12c174..f4e28e7ed 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -76,7 +76,7 @@ static void pruneExtendedNamespaces( Inkscape::XML::Node *repr ) } // Can't change the set we're interating over while we are iterating. for ( std::vector::iterator it = attrsRemoved.begin(); it != attrsRemoved.end(); ++it ) { - repr->setAttribute(*it, 0); + repr->setAttribute(*it, nullptr); } } @@ -225,11 +225,11 @@ Svg::open (Inkscape::Extension::Input *mod, const gchar *uri) prefs->setBool("/dialogs/import/ask", !mod->get_param_bool("do_not_ask") ); } - SPDocument * doc = SPDocument::createNewDoc (NULL, TRUE, TRUE); + SPDocument * doc = SPDocument::createNewDoc (nullptr, TRUE, TRUE); if (link_svg.compare("include") != 0 && is_import) { bool embed = ( link_svg.compare( "embed" ) == 0 ); SPDocument * ret = SPDocument::createNewDoc(uri, TRUE); - SPNamedView *nv = sp_document_namedview(doc, NULL); + SPNamedView *nv = sp_document_namedview(doc, nullptr); Glib::ustring display_unit = nv->display_units->abbr; if (display_unit.empty()) { display_unit = "px"; @@ -259,7 +259,7 @@ Svg::open (Inkscape::Extension::Input *mod, const gchar *uri) sp_embed_svg(image_node, uri); } } else { - gchar* _uri = g_filename_to_uri(uri, NULL, NULL); + gchar* _uri = g_filename_to_uri(uri, nullptr, nullptr); if(_uri) { image_node->setAttribute("xlink:href", _uri); g_free(_uri); @@ -292,7 +292,7 @@ Svg::open (Inkscape::Extension::Input *mod, const gchar *uri) return SPDocument::createNewDocFromMem(contents, length, 1); } catch (Gio::Error &e) { g_warning("Could not load contents of non-local URI %s\n", uri); - return NULL; + return nullptr; } } else { uri = path.c_str(); @@ -329,8 +329,8 @@ Svg::open (Inkscape::Extension::Input *mod, const gchar *uri) void Svg::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { - g_return_if_fail(doc != NULL); - g_return_if_fail(filename != NULL); + g_return_if_fail(doc != nullptr); + g_return_if_fail(filename != nullptr); Inkscape::XML::Document *rdoc = doc->rdoc; bool const exportExtensions = ( !mod->get_id() -- cgit v1.2.3