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/attribute-sort-util.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/attribute-sort-util.cpp') diff --git a/src/attribute-sort-util.cpp b/src/attribute-sort-util.cpp index 7aa8d8357..28a4d4f5a 100644 --- a/src/attribute-sort-util.cpp +++ b/src/attribute-sort-util.cpp @@ -32,7 +32,7 @@ using Inkscape::Util::List; */ void sp_attribute_sort_tree(Node *repr) { - g_return_if_fail (repr != NULL); + g_return_if_fail (repr != nullptr); sp_attribute_sort_recursive( repr ); } @@ -42,7 +42,7 @@ void sp_attribute_sort_tree(Node *repr) { */ void sp_attribute_sort_recursive(Node *repr) { - g_return_if_fail (repr != NULL); + g_return_if_fail (repr != nullptr); if( repr->type() == Inkscape::XML::ELEMENT_NODE ) { Glib::ustring element = repr->name(); @@ -75,7 +75,7 @@ bool cmp(std::pair< Glib::ustring, Glib::ustring > const &a, */ void sp_attribute_sort_element(Node *repr) { - g_return_if_fail (repr != NULL); + g_return_if_fail (repr != nullptr); g_return_if_fail (repr->type() == Inkscape::XML::ELEMENT_NODE); // Glib::ustring element = repr->name(); @@ -105,7 +105,7 @@ void sp_attribute_sort_element(Node *repr) { it != my_list.end(); ++it) { // Removing "inkscape:label" results in crash when Layers dialog is open. if (it->first != "inkscape:label") { - repr->setAttribute( it->first.c_str(), NULL, false ); + repr->setAttribute( it->first.c_str(), nullptr, false ); } } // Insert all attributes in proper order @@ -123,7 +123,7 @@ void sp_attribute_sort_element(Node *repr) { */ void sp_attribute_sort_style(Node *repr) { - g_return_if_fail (repr != NULL); + g_return_if_fail (repr != nullptr); g_return_if_fail (repr->type() == Inkscape::XML::ELEMENT_NODE); // Find element's style @@ -135,7 +135,7 @@ void sp_attribute_sort_style(Node *repr) { Glib::ustring value; sp_repr_css_write_string(css, value); if( value.empty() ) { - repr->setAttribute("style", NULL ); + repr->setAttribute("style", nullptr ); } else { repr->setAttribute("style", value.c_str()); } @@ -149,7 +149,7 @@ void sp_attribute_sort_style(Node *repr) { */ Glib::ustring sp_attribute_sort_style(Node *repr, gchar const *string) { - g_return_val_if_fail (repr != NULL, NULL); + g_return_val_if_fail (repr != nullptr, NULL); g_return_val_if_fail (repr->type() == Inkscape::XML::ELEMENT_NODE, NULL); SPCSSAttr *css = sp_repr_css_attr_new(); @@ -169,11 +169,11 @@ Glib::ustring sp_attribute_sort_style(Node *repr, gchar const *string) { */ void sp_attribute_sort_style(Node* repr, SPCSSAttr *css) { - g_return_if_fail (repr != NULL); - g_return_if_fail (css != NULL); + g_return_if_fail (repr != nullptr); + g_return_if_fail (css != nullptr); Glib::ustring element = repr->name(); - Glib::ustring id = (repr->attribute( "id" )==NULL ? "" : repr->attribute( "id" )); + Glib::ustring id = (repr->attribute( "id" )==nullptr ? "" : repr->attribute( "id" )); // Loop over all properties in "style" node. std::vector > my_list; @@ -190,7 +190,7 @@ void sp_attribute_sort_style(Node* repr, SPCSSAttr *css) { //for (auto it: my_list) { for (std::vector >::iterator it = my_list.begin(); it != my_list.end(); ++it) { - sp_repr_css_set_property( css, it->first.c_str(), NULL ); + sp_repr_css_set_property( css, it->first.c_str(), nullptr ); } // Insert all attributes in proper order for (std::vector >::iterator it = my_list.begin(); -- cgit v1.2.3