diff options
| author | Jabiertxof <jtx@jtx> | 2016-12-07 22:17:49 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2016-12-07 22:17:49 +0000 |
| commit | 6586a50de3ad7f47a895f904ff66cc6613d62124 (patch) | |
| tree | 40fd2385e192f4fb9212cbb6ace4197fa35e47b1 /src | |
| parent | Fix for reopened bug #1643408- minor typyng (diff) | |
| download | inkscape-6586a50de3ad7f47a895f904ff66cc6613d62124.tar.gz inkscape-6586a50de3ad7f47a895f904ff66cc6613d62124.zip | |
Improve measure line to allow similar LPE
(bzr r15310)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-measure-line.cpp | 5 | ||||
| -rw-r--r-- | src/sp-lpe-item.cpp | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/live_effects/lpe-measure-line.cpp b/src/live_effects/lpe-measure-line.cpp index 8b73781b5..45076d625 100644 --- a/src/live_effects/lpe-measure-line.cpp +++ b/src/live_effects/lpe-measure-line.cpp @@ -686,7 +686,6 @@ LPEMeasureLine::doBeforeEffect (SPLPEItem const* lpeitem) } } - void LPEMeasureLine::doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) { @@ -696,6 +695,7 @@ LPEMeasureLine::doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) void LPEMeasureLine::doOnRemove (SPLPEItem const* /*lpeitem*/) { + //unset "erase_extra_objects" hook on sp-lpe-item.cpp if (!erase_extra_objects) { processObjects(LPE_TO_OBJECTS); elements.clear(); @@ -711,6 +711,9 @@ LPEMeasureLine::processObjects(LpeAction lpe_action) for (std::vector<const char *>::iterator el_it = elements.begin(); el_it != elements.end(); ++el_it) { const char * id = *el_it; + if (!id || strlen(id) == 0) { + return; + } Inkscape::URI SVGElem_uri(Glib::ustring("#").append(id).c_str()); Inkscape::URIReference* SVGElemRef = new Inkscape::URIReference(desktop->doc()); SVGElemRef->attach(SVGElem_uri); diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 872a88289..e2f61bfb5 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -125,7 +125,8 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { { if (!value) { LivePathEffectObject *lpeobj = (*it)->lpeobject; - if (Inkscape::LivePathEffect::LPEMeasureLine * lpe = dynamic_cast<Inkscape::LivePathEffect::LPEMeasureLine *>(lpeobj->get_lpe())) { + Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe(); + if (dynamic_cast<Inkscape::LivePathEffect::LPEMeasureLine *>(lpe)){ lpe->doOnRemove(this); } } |
