summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d181081)
raw | patch | inline | side by side (parent: d181081)
author | jucablues <jucablues@users.sourceforge.net> | |
Wed, 16 Jan 2008 10:50:24 +0000 (10:50 +0000) | ||
committer | jucablues <jucablues@users.sourceforge.net> | |
Wed, 16 Jan 2008 10:50:24 +0000 (10:50 +0000) |
src/sp-fedisplacementmap.cpp | patch | blob | history |
index 1eb3f3656c5520b4847cd9ec74d70756bdf00f88..0fb5318422076192fcfa5373076e871a6323ac70 100644 (file)
#include "sp-fedisplacementmap.h"
#include "xml/repr.h"
#include "display/nr-filter-displacement-map.h"
+#include "helper-fns.h"
/* FeDisplacementMap base class */
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);