From: kiirala Date: Sat, 14 Jul 2007 21:54:16 +0000 (+0000) Subject: Fixed assertion failure with some unset parameters for feComposite & feOffset X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0fd3803adb2c436ed6de1fa226ac1652168a27ca;p=inkscape.git Fixed assertion failure with some unset parameters for feComposite & feOffset --- diff --git a/src/sp-fecomposite.cpp b/src/sp-fecomposite.cpp index 68312aa1b..b191f9826 100644 --- a/src/sp-fecomposite.cpp +++ b/src/sp-fecomposite.cpp @@ -122,6 +122,8 @@ sp_feComposite_release(SPObject *object) static double sp_feComposite_read_number(gchar const *value) { + if (!value) return 0; + char *end; double ret = g_ascii_strtod(value, &end); if (*end) { diff --git a/src/sp-feoffset.cpp b/src/sp-feoffset.cpp index 284846855..03d8b6227 100644 --- a/src/sp-feoffset.cpp +++ b/src/sp-feoffset.cpp @@ -111,6 +111,7 @@ sp_feOffset_release(SPObject *object) static double sp_feOffset_read_number(gchar const *value) { + if (!value) return 0; char *end; double ret = g_ascii_strtod(value, &end); if (*end) { @@ -130,14 +131,21 @@ sp_feOffset_set(SPObject *object, unsigned int key, gchar const *value) { SPFeOffset *feOffset = SP_FEOFFSET(object); + double read_num; switch(key) { case SP_ATTR_DX: - feOffset->dx = sp_feOffset_read_number(value); - object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); + read_num = sp_feOffset_read_number(value); + if (read_num != feOffset->dx) { + feOffset->dx = read_num; + object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); + } break; case SP_ATTR_DY: - feOffset->dy = sp_feOffset_read_number(value); - object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); + read_num = sp_feOffset_read_number(value); + if (read_num != feOffset->dy) { + feOffset->dy = read_num; + object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); + } break; /*DEAL WITH SETTING ATTRIBUTES HERE*/