diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp
index 719d1d25b552a9e281f5e64dc0e159cb7e9f4bb3..37e266da046e17f9b89a669c4d45c6ede30da13a 100644 (file)
--- a/src/sp-glyph.cpp
+++ b/src/sp-glyph.cpp
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#ifdef ENABLE_SVG_FONTS
#define __SP_GLYPH_C__
* SVG <glyph> element implementation
*
* Author:
- * Felipe C. da S. Sanches <felipe.sanches@gmail.com>
+ * Felipe C. da S. Sanches <juca@members.fsf.org>
*
* Copyright (C) 2008, Felipe C. da S. Sanches
*
static void sp_glyph_init(SPGlyph *glyph)
{
//TODO: correct these values:
- glyph->unicode = NULL;
- glyph->glyph_name = NULL;
+
+ new (&glyph->unicode) Glib::ustring();
+ new (&glyph->glyph_name) Glib::ustring();
glyph->d = NULL;
glyph->orientation = GLYPH_ORIENTATION_BOTH;
glyph->arabic_form = GLYPH_ARABIC_FORM_INITIAL;
@@ -148,22 +152,19 @@ static void sp_glyph_set(SPObject *object, unsigned int key, const gchar *value)
switch (key) {
case SP_ATTR_UNICODE:
- if (glyph->unicode) g_free(glyph->unicode);
- glyph->unicode = g_strdup(value);
+ glyph->unicode.clear();
+ if (value) glyph->unicode.append(value);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
-g_warning("<glyph>: SP_ATTR_UNICODE: %s", value);
- break;
+ break;
case SP_ATTR_GLYPH_NAME:
- if (glyph->glyph_name) g_free(glyph->glyph_name);
- glyph->glyph_name = g_strdup(value);
+ glyph->glyph_name.clear();
+ if (value) glyph->glyph_name.append(value);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
-g_warning("<glyph>: SP_ATTR_GLYPH_NAME: %s", value);
- break;
+ break;
case SP_ATTR_D:
if (glyph->d) g_free(glyph->d);
glyph->d = g_strdup(value);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
-g_warning("<glyph>: SP_ATTR_D: %s", value);
break;
case SP_ATTR_ORIENTATION:
orient = sp_glyph_read_orientation(value);
glyph->orientation = orient;
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
-g_warning("<glyph>: SP_ATTR_ORIENTATION: %d", orient);
break;
case SP_ATTR_ARABIC_FORM:
form = sp_glyph_read_arabic_form(value);
glyph->arabic_form = form;
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
-g_warning("<glyph>: SP_ATTR_ARABIC_FORM: %d", glyph->arabic_form);
break;
case SP_ATTR_LANG:
if (glyph->lang) g_free(glyph->lang);
glyph->lang = g_strdup(value);
-g_warning("<glyph>: SP_ATTR_LANG: %s", value);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_HORIZ_ADV_X:
number = helperfns_read_number(value);
if (number != glyph->horiz_adv_x){
glyph->horiz_adv_x = number;
-g_warning("<glyph>: SP_ATTR_HORIZ_ADV_X: %f", number);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
break;
number = helperfns_read_number(value);
if (number != glyph->vert_origin_x){
glyph->vert_origin_x = number;
-g_warning("<glyph>: SP_ATTR_VERT_ORIGIN_X: %f", number);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
break;
number = helperfns_read_number(value);
if (number != glyph->vert_origin_y){
glyph->vert_origin_y = number;
-g_warning("<glyph>: SP_ATTR_VERT_ORIGIN_Y: %f", number);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
break;
number = helperfns_read_number(value);
if (number != glyph->vert_adv_y){
glyph->vert_adv_y = number;
-g_warning("<glyph>: SP_ATTR_VERT_ADV_Y: %f", number);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
break;