summaryrefslogtreecommitdiffstats
path: root/src/sp-use-reference.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2013-11-14 17:42:21 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2013-11-14 17:42:21 +0000
commit88a0981f89303f39ec291bd5b477e311d258425c (patch)
treebb7cd5397cf24144b27dd7fea9e062165a1abf0b /src/sp-use-reference.cpp
parentsplivarot: Clean up assertions where possible (diff)
downloadinkscape-88a0981f89303f39ec291bd5b477e311d258425c.tar.gz
inkscape-88a0981f89303f39ec291bd5b477e311d258425c.zip
More scan-build null pointer checks
(bzr r12814)
Diffstat (limited to 'src/sp-use-reference.cpp')
-rw-r--r--src/sp-use-reference.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/sp-use-reference.cpp b/src/sp-use-reference.cpp
index ec03ffce6..642cfede8 100644
--- a/src/sp-use-reference.cpp
+++ b/src/sp-use-reference.cpp
@@ -215,23 +215,26 @@ void SPUsePath::refresh_source()
// [tr: The bad case: no d attribute. Must check that it's a SPShape and then take the outline.]
SPObject *refobj = sourceObject;
if ( refobj == NULL ) return;
+
SPItem *item = SP_ITEM(refobj);
-
SPCurve *curve = NULL;
- if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item)) {
- return;
- }
- if (SP_IS_SHAPE(item)) {
+
+ if (SP_IS_SHAPE(item))
+ {
curve = SP_SHAPE(item)->getCurve();
- if (curve == NULL)
- return;
}
- if (SP_IS_TEXT(item)) {
+ else if (SP_IS_TEXT(item))
+ {
curve = SP_TEXT(item)->getNormalizedBpath();
- if (curve == NULL) {
- return;
- }
}
+ else
+ {
+ return;
+ }
+
+ if (curve == NULL)
+ return;
+
originalPath = new Path;
originalPath->LoadPathVector(curve->get_pathvector(), item->transform, true);
curve->unref();