X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-glyph-kerning.cpp;h=6d08f212cea1318cb9ad2a6037dc06aadca59072;hb=e5d48f600ce8a65ae81353fd39860227b2ef6e60;hp=c8138731ebcced61ab60de7c60c051367b380e7f;hpb=f45619747d788d05b19687aedde8620096f50048;p=inkscape.git diff --git a/src/sp-glyph-kerning.cpp b/src/sp-glyph-kerning.cpp index c8138731e..6d08f212c 100644 --- a/src/sp-glyph-kerning.cpp +++ b/src/sp-glyph-kerning.cpp @@ -1,4 +1,7 @@ -#include "config.h" +#ifdef HAVE_CONFIG_H +# include +#endif + #ifdef ENABLE_SVG_FONTS #define __SP_ANCHOR_C__ @@ -132,7 +135,7 @@ GlyphNames::~GlyphNames(){ if (this->names) g_free(this->names); } -bool GlyphNames::contains(gchar* name){ +bool GlyphNames::contains(const char* name){ if (!(this->names) || !name) return false; std::istringstream is(this->names); std::string str; @@ -147,38 +150,32 @@ static void sp_glyph_kerning_set(SPObject *object, unsigned int key, const gchar { SPGlyphKerning * glyphkern = (SPGlyphKerning*) object; //even if it is a VKern this will work. I did it this way just to avoind warnings. double number; - const char* tag = (SP_IS_HKERN(object) ? "hkern" : "vkern"); switch (key) { case SP_ATTR_U1: if (glyphkern->u1) delete glyphkern->u1; glyphkern->u1 = new UnicodeRange(value); object->requestModified(SP_OBJECT_MODIFIED_FLAG); -g_warning("<%s>: SP_ATTR_U1: %s", tag, value); - break; + break; case SP_ATTR_U2: if (glyphkern->u2) delete glyphkern->u2; glyphkern->u2 = new UnicodeRange(value); object->requestModified(SP_OBJECT_MODIFIED_FLAG); -g_warning("<%s>: SP_ATTR_U2: %s", tag, value); - break; + break; case SP_ATTR_G1: if (glyphkern->g1) delete glyphkern->g1; glyphkern->g1 = new GlyphNames(value); object->requestModified(SP_OBJECT_MODIFIED_FLAG); -g_warning("<%s>: SP_ATTR_G1: %s", tag, value); - break; + break; case SP_ATTR_G2: if (glyphkern->g2) delete glyphkern->g2; glyphkern->g2 = new GlyphNames(value); object->requestModified(SP_OBJECT_MODIFIED_FLAG); -g_warning("<%s>: SP_ATTR_G2: %s", tag, value); break; case SP_ATTR_K: number = helperfns_read_number(value); if (number != glyphkern->k){ glyphkern->k = number; -g_warning("<%s>: SP_ATTR_K: %f", tag, number); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } break; @@ -188,7 +185,6 @@ g_warning("<%s>: SP_ATTR_K: %f", tag, number); } break; } -///should free tag? } /** @@ -203,7 +199,6 @@ sp_glyph_kerning_update(SPObject *object, SPCtx *ctx, guint flags) if (flags & SP_OBJECT_MODIFIED_FLAG) { /* do something to trigger redisplay, updates? */ sp_object_read_attr(object, "u1"); - sp_object_read_attr(object, "g1"); sp_object_read_attr(object, "u2"); sp_object_read_attr(object, "g2"); sp_object_read_attr(object, "k");