diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-09-14 06:27:21 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-09-14 06:27:21 +0000 |
| commit | 9d32539b23031c0e0d1a24c083fc609975a459e2 (patch) | |
| tree | e49d90232f01941bc49fbece3ff715790830649b /src/knotholder.cpp | |
| parent | add radius support to fillet-chamfer, bugfixes (diff) | |
| parent | Update to experimental r13543 (diff) | |
| download | inkscape-9d32539b23031c0e0d1a24c083fc609975a459e2.tar.gz inkscape-9d32539b23031c0e0d1a24c083fc609975a459e2.zip | |
Merge in ponyscape features by Theo and worked on my LiamW
(bzr r13341.1.204)
Diffstat (limited to 'src/knotholder.cpp')
| -rw-r--r-- | src/knotholder.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/knotholder.cpp b/src/knotholder.cpp index f0e69716b..b8d941bf7 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -154,8 +154,15 @@ KnotHolder::knot_clicked_handler(SPKnot *knot, guint state) } // for drag, this is done by ungrabbed_handler, but for click we must do it here - DocumentUndo::done(saved_item->document, object_verb, - _("Change handle")); + + if (saved_item) { //increasingly aggressive sanity checks + if (saved_item->document) { + if (object_verb <= SP_VERB_LAST && object_verb >= SP_VERB_INVALID) { + DocumentUndo::done(saved_item->document, object_verb, + _("Change handle")); + } + } + } // else { abort(); } } void @@ -203,14 +210,16 @@ KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/, guint) /* do cleanup tasks (e.g., for LPE items write the parameter values * that were changed by dragging the handle to SVG) */ - if (SP_IS_LPE_ITEM(object)) { + if (dynamic_cast<SPLPEItem*> (object)) { // This writes all parameters to SVG. Is this sufficiently efficient or should we only // write the ones that were changed? - - Inkscape::LivePathEffect::Effect *lpe = SP_LPE_ITEM(object)->getCurrentLPE(); - if (lpe) { - LivePathEffectObject *lpeobj = lpe->getLPEObj(); - lpeobj->updateRepr(); + SPLPEItem * lpeitem = SP_LPE_ITEM(object); + if (lpeitem) { + Inkscape::LivePathEffect::Effect *lpe = lpeitem->getCurrentLPE(); + if (lpe) { + LivePathEffectObject *lpeobj = lpe->getLPEObj(); + lpeobj->updateRepr(); + } } } @@ -232,9 +241,14 @@ KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/, guint) else object_verb = SP_VERB_SELECTION_DYNAMIC_OFFSET; } - - DocumentUndo::done(object->document, object_verb, - _("Move handle")); + if (object) { //increasingly aggressive sanity checks + if (object->document) { + if (object_verb <= SP_VERB_LAST && object_verb >= SP_VERB_INVALID) { + DocumentUndo::done(object->document, object_verb, + _("Move handle")); + } + } + } //else { abort(); } } } |
