summaryrefslogtreecommitdiffstats
path: root/src/sp-lpe-item.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-10-27 18:03:09 +0000
committerTed Gould <ted@canonical.com>2008-10-27 18:03:09 +0000
commit7dbe11bc23efa5f51a9b84e7d0f6dd16e63e0902 (patch)
tree7d3a2b95b84a03a19cb132cdf88bea0ab6dc4773 /src/sp-lpe-item.cpp
parentMerging from trunk (diff)
downloadinkscape-7dbe11bc23efa5f51a9b84e7d0f6dd16e63e0902.tar.gz
inkscape-7dbe11bc23efa5f51a9b84e7d0f6dd16e63e0902.zip
From trunk
(bzr r6885)
Diffstat (limited to 'src/sp-lpe-item.cpp')
-rw-r--r--src/sp-lpe-item.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 5ab9e27d6..0fe02e01d 100644
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -309,11 +309,17 @@ void sp_lpe_item_perform_path_effect(SPLPEItem *lpeitem, SPCurve *curve) {
{
LivePathEffectObject *lpeobj = (*it)->lpeobject;
if (!lpeobj) {
+ /** \todo Investigate the cause of this.
+ * For example, this happens when copy pasting an object with LPE applied. Probably because the object is pasted while the effect is not yet pasted to defs, and cannot be found.
+ */
g_warning("sp_lpe_item_perform_path_effect - NULL lpeobj in list!");
return;
}
Inkscape::LivePathEffect::Effect *lpe = lpeobj->get_lpe();
if (!lpe) {
+ /** \todo Investigate the cause of this.
+ * Not sure, but I think this can happen when an unknown effect type is specified...
+ */
g_warning("sp_lpe_item_perform_path_effect - lpeobj without lpe!");
return;
}
@@ -335,8 +341,10 @@ void sp_lpe_item_perform_path_effect(SPLPEItem *lpeitem, SPCurve *curve) {
}
catch (std::exception & e) {
g_warning("Exception during LPE %s execution. \n %s", lpe->getName().c_str(), e.what());
- SP_ACTIVE_DESKTOP->messageStack()->flash( Inkscape::WARNING_MESSAGE,
- _("An exception occurred during execution of the Path Effect.") );
+ if (SP_ACTIVE_DESKTOP && SP_ACTIVE_DESKTOP->messageStack()) {
+ SP_ACTIVE_DESKTOP->messageStack()->flash( Inkscape::WARNING_MESSAGE,
+ _("An exception occurred during execution of the Path Effect.") );
+ }
}
}
}
@@ -362,11 +370,13 @@ sp_lpe_item_update_patheffect (SPLPEItem *lpeitem, bool wholetree, bool write)
PathEffectList lpelist = sp_lpe_item_get_effect_list(lpeitem);
std::list<Inkscape::LivePathEffect::LPEObjectReference *>::iterator i;
for (i = lpelist.begin(); i != lpelist.end(); ++i) {
- Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->get_lpe();
- if (dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)) {
- if (!lpe->isVisible()) {
- // we manually disable text for LPEPathLength
- dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)->hideCanvasText();
+ if ((*i)->lpeobject) {
+ Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->get_lpe();
+ if (dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)) {
+ if (!lpe->isVisible()) {
+ // we manually disable text for LPEPathLength
+ dynamic_cast<Inkscape::LivePathEffect::LPEPathLength *>(lpe)->hideCanvasText();
+ }
}
}
}