diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-09-23 21:32:47 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-09-23 21:32:47 +0000 |
| commit | 001281487edbd7bca8ee9fba1135b84dba3c9c36 (patch) | |
| tree | 7230e9e6b973e457aea80c1b33e245be62e605b6 /src | |
| parent | * Bad translation, spotted by Andrea Celli (diff) | |
| download | inkscape-001281487edbd7bca8ee9fba1135b84dba3c9c36.tar.gz inkscape-001281487edbd7bca8ee9fba1135b84dba3c9c36.zip | |
fix crash on entering invalid lpe name in xml
(bzr r6873)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpeobject.cpp | 7 | ||||
| -rw-r--r-- | src/sp-lpe-item.cpp | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/live_effects/lpeobject.cpp b/src/live_effects/lpeobject.cpp index a73f9ccd6..ab49de14f 100644 --- a/src/live_effects/lpeobject.cpp +++ b/src/live_effects/lpeobject.cpp @@ -215,12 +215,11 @@ livepatheffect_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscap repr = xml_doc->createElement("inkscape:path-effect"); } - if ((flags & SP_OBJECT_WRITE_ALL) || lpeobj->effecttype_set) + if ((flags & SP_OBJECT_WRITE_ALL) || lpeobj->lpe) { repr->setAttribute("effect", Inkscape::LivePathEffect::LPETypeConverter.get_key(lpeobj->effecttype).c_str()); -// lpeobj->lpe->write(repr); something like this. - - lpeobj->lpe->writeParamsToSVG(); + lpeobj->lpe->writeParamsToSVG(); + } if (((SPObjectClass *) livepatheffect_parent_class)->write) (* ((SPObjectClass *) livepatheffect_parent_class)->write)(object, xml_doc, repr, flags); diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 56ffd190c..89d41be76 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -202,21 +202,20 @@ sp_lpe_item_set(SPObject *object, unsigned int key, gchar const *value) std::string href; while (std::getline(iss, href, ';')) { - Inkscape::LivePathEffect::LPEObjectReference *path_effect_ref; - path_effect_ref = new Inkscape::LivePathEffect::LPEObjectReference(SP_OBJECT(lpeitem)); + Inkscape::LivePathEffect::LPEObjectReference *path_effect_ref = new Inkscape::LivePathEffect::LPEObjectReference(SP_OBJECT(lpeitem)); path_effect_ref->changedSignal().connect(sigc::bind(sigc::ptr_fun(lpeobject_ref_changed), SP_LPE_ITEM(object))); // Now do the attaching, which emits the changed signal. // Fixme, it should not do this changed signal and updating before all effects are added to the path_effect_list try { path_effect_ref->link(href.c_str()); - } catch (Inkscape::BadURIException &e) { + } catch (Inkscape::BadURIException e) { g_warning("BadURIException: %s", e.what()); path_effect_ref->unlink(); delete path_effect_ref; path_effect_ref = NULL; } - if (path_effect_ref) { + if (path_effect_ref && path_effect_ref->lpeobject && path_effect_ref->lpeobject->lpe) { lpeitem->path_effect_list->push_back(path_effect_ref); } } |
