summaryrefslogtreecommitdiffstats
path: root/src/object/sp-flowregion.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-15 10:46:15 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-18 12:27:01 +0000
commitf4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch)
tree7c6044fd3a17a2665841959dac9b3b2110b27924 /src/object/sp-flowregion.cpp
parentRun clang-tidy’s modernize-use-override pass. (diff)
downloadinkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.tar.gz
inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.zip
Run clang-tidy’s modernize-use-nullptr pass.
This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer.
Diffstat (limited to 'src/object/sp-flowregion.cpp')
-rw-r--r--src/object/sp-flowregion.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/object/sp-flowregion.cpp b/src/object/sp-flowregion.cpp
index 6640d93c2..3e7732e1a 100644
--- a/src/object/sp-flowregion.cpp
+++ b/src/object/sp-flowregion.cpp
@@ -67,7 +67,7 @@ void SPFlowregion::update(SPCtx *ctx, unsigned int flags) {
}
for (auto child:l) {
- g_assert(child != NULL);
+ g_assert(child != nullptr);
SPItem *item = dynamic_cast<SPItem *>(child);
if (childflags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
@@ -97,7 +97,7 @@ void SPFlowregion::UpdateComputed(void)
computed.clear();
for (auto& child: children) {
- Shape *shape = 0;
+ Shape *shape = nullptr;
GetDest(&child, &shape);
computed.push_back(shape);
}
@@ -118,7 +118,7 @@ void SPFlowregion::modified(guint flags) {
}
for (auto child:l) {
- g_assert(child != NULL);
+ g_assert(child != nullptr);
if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
child->emitModified(flags);
@@ -130,14 +130,14 @@ void SPFlowregion::modified(guint flags) {
Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
if (flags & SP_OBJECT_WRITE_BUILD) {
- if ( repr == NULL ) {
+ if ( repr == nullptr ) {
repr = xml_doc->createElement("svg:flowRegion");
}
std::vector<Inkscape::XML::Node *> l;
for (auto& child: children) {
if ( !dynamic_cast<SPTitle *>(&child) && !dynamic_cast<SPDesc *>(&child) ) {
- Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags);
+ Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, nullptr, flags);
if (crepr) {
l.push_back(crepr);
@@ -146,7 +146,7 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc
}
for (auto i = l.rbegin(); i != l.rend(); ++i) {
- repr->addChild(*i, NULL);
+ repr->addChild(*i, nullptr);
Inkscape::GC::release(*i);
}
@@ -170,13 +170,13 @@ const char* SPFlowregion::displayName() const {
}
SPFlowregionExclude::SPFlowregionExclude() : SPItem() {
- this->computed = NULL;
+ this->computed = nullptr;
}
SPFlowregionExclude::~SPFlowregionExclude() {
if (this->computed) {
delete this->computed;
- this->computed = NULL;
+ this->computed = nullptr;
}
}
@@ -215,7 +215,7 @@ void SPFlowregionExclude::update(SPCtx *ctx, unsigned int flags) {
}
for(auto child:l) {
- g_assert(child != NULL);
+ g_assert(child != nullptr);
if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
SPItem *item = dynamic_cast<SPItem *>(child);
@@ -240,7 +240,7 @@ void SPFlowregionExclude::UpdateComputed(void)
{
if (computed) {
delete computed;
- computed = NULL;
+ computed = nullptr;
}
for (auto& child: children) {
@@ -263,7 +263,7 @@ void SPFlowregionExclude::modified(guint flags) {
}
for (auto child:l) {
- g_assert(child != NULL);
+ g_assert(child != nullptr);
if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
child->emitModified(flags);
@@ -275,14 +275,14 @@ void SPFlowregionExclude::modified(guint flags) {
Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
if (flags & SP_OBJECT_WRITE_BUILD) {
- if ( repr == NULL ) {
+ if ( repr == nullptr ) {
repr = xml_doc->createElement("svg:flowRegionExclude");
}
std::vector<Inkscape::XML::Node *> l;
for (auto& child: children) {
- Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags);
+ Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, nullptr, flags);
if (crepr) {
l.push_back(crepr);
@@ -290,7 +290,7 @@ Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc
}
for (auto i = l.rbegin(); i != l.rend(); ++i) {
- repr->addChild(*i, NULL);
+ repr->addChild(*i, nullptr);
Inkscape::GC::release(*i);
}
@@ -315,7 +315,7 @@ const char* SPFlowregionExclude::displayName() const {
static void UnionShape(Shape **base_shape, Shape const *add_shape)
{
- if (*base_shape == NULL)
+ if (*base_shape == nullptr)
*base_shape = new Shape;
if ( (*base_shape)->hasEdges() == false ) {
(*base_shape)->Copy(const_cast<Shape*>(add_shape));
@@ -329,14 +329,14 @@ static void UnionShape(Shape **base_shape, Shape const *add_shape)
static void GetDest(SPObject* child,Shape **computed)
{
- if ( child == NULL ) return;
+ if ( child == nullptr ) return;
- SPCurve *curve=NULL;
+ SPCurve *curve=nullptr;
Geom::Affine tr_mat;
SPObject* u_child = child;
SPItem *item = dynamic_cast<SPItem *>(u_child);
- g_assert(item != NULL);
+ g_assert(item != nullptr);
SPUse *use = dynamic_cast<SPUse *>(item);
if ( use ) {
u_child = use->child;