diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-03-30 08:07:19 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-03-30 08:07:19 +0000 |
| commit | d7d33e03d7daac4be14018d31cd6f534fcb7f7a4 (patch) | |
| tree | 1e36847829d56126a957bbab4fc5e8ff804a79a3 /src/sp-missing-glyph.cpp | |
| parent | Fix logic to avoid too many updates while dragging color sliders. Fixes bug# ... (diff) | |
| download | inkscape-d7d33e03d7daac4be14018d31cd6f534fcb7f7a4.tar.gz inkscape-d7d33e03d7daac4be14018d31cd6f534fcb7f7a4.zip | |
Corrected string-to-number conversion to use locale-independent conversion and to handle missing/null values. Fixes bug #544833.
Fixed bugs:
- https://launchpad.net/bugs/544833
(bzr r9259)
Diffstat (limited to 'src/sp-missing-glyph.cpp')
| -rw-r--r-- | src/sp-missing-glyph.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/sp-missing-glyph.cpp b/src/sp-missing-glyph.cpp index d25a5f812..7d5c42763 100644 --- a/src/sp-missing-glyph.cpp +++ b/src/sp-missing-glyph.cpp @@ -20,7 +20,6 @@ #include "attributes.h" #include "sp-missing-glyph.h" #include "document.h" -#include "helper-fns.h" static void sp_missing_glyph_class_init(SPMissingGlyphClass *gc); static void sp_missing_glyph_init(SPMissingGlyph *glyph); @@ -102,47 +101,60 @@ static void sp_missing_glyph_release(SPObject *object) static void sp_missing_glyph_set(SPObject *object, unsigned int key, const gchar *value) { SPMissingGlyph *glyph = SP_MISSING_GLYPH(object); - double number; switch (key) { case SP_ATTR_D: - if (glyph->d) g_free(glyph->d); + { + if (glyph->d) { + g_free(glyph->d); + } glyph->d = g_strdup(value); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; - case SP_ATTR_HORIZ_ADV_X: - number = helperfns_read_number(value); + } + case SP_ATTR_HORIZ_ADV_X: + { + double number = value ? g_ascii_strtod(value, 0) : 0; if (number != glyph->horiz_adv_x){ glyph->horiz_adv_x = number; object->requestModified(SP_OBJECT_MODIFIED_FLAG); } break; - case SP_ATTR_VERT_ORIGIN_X: - number = helperfns_read_number(value); + } + case SP_ATTR_VERT_ORIGIN_X: + { + double number = value ? g_ascii_strtod(value, 0) : 0; if (number != glyph->vert_origin_x){ glyph->vert_origin_x = number; object->requestModified(SP_OBJECT_MODIFIED_FLAG); } break; - case SP_ATTR_VERT_ORIGIN_Y: - number = helperfns_read_number(value); + } + case SP_ATTR_VERT_ORIGIN_Y: + { + double number = value ? g_ascii_strtod(value, 0) : 0; if (number != glyph->vert_origin_y){ glyph->vert_origin_y = number; object->requestModified(SP_OBJECT_MODIFIED_FLAG); } break; - case SP_ATTR_VERT_ADV_Y: - number = helperfns_read_number(value); + } + case SP_ATTR_VERT_ADV_Y: + { + double number = value ? g_ascii_strtod(value, 0) : 0; if (number != glyph->vert_adv_y){ glyph->vert_adv_y = number; object->requestModified(SP_OBJECT_MODIFIED_FLAG); } break; - default: + } + default: + { if (((SPObjectClass *) (parent_class))->set) { ((SPObjectClass *) (parent_class))->set(object, key, value); } break; + } } } |
