diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-11-14 15:36:14 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-11-14 15:36:14 +0000 |
| commit | bfa22b6db8210782ead109809f166726314f09ac (patch) | |
| tree | cf2a08076bd8e32908213a95d6b0cc55e383651a /src/splivarot.cpp | |
| parent | renamed some methods + removed unnecessary text + and fixed start option (diff) | |
| download | inkscape-bfa22b6db8210782ead109809f166726314f09ac.tar.gz inkscape-bfa22b6db8210782ead109809f166726314f09ac.zip | |
splivarot: Clean up assertions where possible
(bzr r12813)
Diffstat (limited to 'src/splivarot.cpp')
| -rw-r--r-- | src/splivarot.cpp | 31 |
1 files changed, 11 insertions, 20 deletions
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 <b>not a path</b>, 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); |
