From bfa22b6db8210782ead109809f166726314f09ac Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 14 Nov 2013 15:36:14 +0000 Subject: splivarot: Clean up assertions where possible (bzr r12813) --- src/splivarot.cpp | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'src/splivarot.cpp') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 7bf556aa1..e5006884c 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -1585,22 +1585,18 @@ void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Selected object is not a path, cannot inset/outset.")); return; } - if (SP_IS_SHAPE(item)) + else if (SP_IS_SHAPE(item)) { curve = SP_SHAPE(item)->getCurve(); - if (curve == NULL) { - return; - } } - if (SP_IS_TEXT(item)) + else // Item must be SP_TEXT { curve = SP_TEXT(item)->getNormalizedBpath(); - if (curve == NULL) { - return; - } } - - g_assert(curve != NULL); + + if (curve == NULL) { + return; + } Geom::Affine const transform(item->transform); @@ -1779,24 +1775,19 @@ sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset) items = items->next) { SPItem *item = SP_ITEM(items->data); + SPCurve *curve = NULL; if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item)) continue; - - SPCurve *curve = NULL; - if (SP_IS_SHAPE(item)) { + else if (SP_IS_SHAPE(item)) { curve = SP_SHAPE(item)->getCurve(); - if (curve == NULL) - continue; } - if (SP_IS_TEXT(item)) { + else { // Item must be SP_TEXT curve = SP_TEXT(item)->getNormalizedBpath(); - if (curve == NULL) - continue; } - // We've now checked that there is a curve for this item - g_assert(curve != NULL); + if (curve == NULL) + continue; Geom::Affine const transform(item->transform); -- cgit v1.2.3