From f1ec6d871e7ddf29a6fcd1ffd7dd1b0e190e229e Mon Sep 17 00:00:00 2001 From: jucablues Date: Wed, 16 Jan 2008 10:50:24 +0000 Subject: [PATCH] just a tiny refactoring --- src/sp-fedisplacementmap.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/sp-fedisplacementmap.cpp b/src/sp-fedisplacementmap.cpp index 1eb3f3656..0fb531842 100644 --- a/src/sp-fedisplacementmap.cpp +++ b/src/sp-fedisplacementmap.cpp @@ -22,6 +22,7 @@ #include "sp-fedisplacementmap.h" #include "xml/repr.h" #include "display/nr-filter-displacement-map.h" +#include "helper-fns.h" /* FeDisplacementMap base class */ @@ -136,20 +137,6 @@ static int sp_feDisplacementMap_readChannelSelector(gchar const *value) return 3; //default is Alpha Channel } -static double -sp_feDisplacementMap_read_number(gchar const *value) { - if (!value) return 0; - char *end; - double ret = g_ascii_strtod(value, &end); - if (*end) { - g_warning("Unable to convert \"%s\" to number", value); - // We could leave this out, too. If strtod can't convert - // anything, it will return zero. - ret = 0; - } - return ret; -} - /** * Sets a specific value in the SPFeDisplacementMap. */ @@ -178,7 +165,7 @@ sp_feDisplacementMap_set(SPObject *object, unsigned int key, gchar const *value) } break; case SP_ATTR_SCALE: - read_num = sp_feDisplacementMap_read_number(value); + read_num = helperfns_read_number(value); if (read_num != feDisplacementMap->scale) { feDisplacementMap->scale = read_num; object->parent->requestModified(SP_OBJECT_MODIFIED_FLAG); -- 2.30.2