~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/sp-glyph-kerning.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * W3C SVG 1.1 spec, page 476, section 20.7
11
11
 *
12
12
 * Author:
13
 
 *   Felipe C. da S. Sanches <felipe.sanches@gmail.com>
 
13
 *   Felipe C. da S. Sanches <juca@members.fsf.org>
14
14
 *
15
15
 * Copyright (C) 2008, Felipe C. da S. Sanches
16
16
 *
22
22
#include "sp-glyph-kerning.h"
23
23
 
24
24
#include "document.h"
25
 
#include "helper-fns.h"
26
25
#include <string>
27
26
 
28
27
static void sp_glyph_kerning_class_init(SPGlyphKerningClass *gc);
149
148
static void sp_glyph_kerning_set(SPObject *object, unsigned int key, const gchar *value)
150
149
{
151
150
    SPGlyphKerning * glyphkern = (SPGlyphKerning*) object; //even if it is a VKern this will work. I did it this way just to avoind warnings.
152
 
    double number;
153
151
 
154
152
    switch (key) {
155
153
        case SP_ATTR_U1:
156
 
            if (glyphkern->u1) delete glyphkern->u1;
 
154
        {
 
155
            if (glyphkern->u1) {
 
156
                delete glyphkern->u1;
 
157
            }
157
158
            glyphkern->u1 = new UnicodeRange(value);
158
159
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
159
160
            break;
 
161
        }
160
162
        case SP_ATTR_U2:
161
 
            if (glyphkern->u2) delete glyphkern->u2;
 
163
        {
 
164
            if (glyphkern->u2) {
 
165
                delete glyphkern->u2;
 
166
            }
162
167
            glyphkern->u2 = new UnicodeRange(value);
163
168
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
164
169
            break;
 
170
        }
165
171
        case SP_ATTR_G1:
166
 
            if (glyphkern->g1) delete glyphkern->g1;
 
172
        {
 
173
            if (glyphkern->g1) {
 
174
                delete glyphkern->g1;
 
175
            }
167
176
            glyphkern->g1 = new GlyphNames(value);
168
177
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
169
178
            break;
 
179
        }
170
180
        case SP_ATTR_G2:
171
 
            if (glyphkern->g2) delete glyphkern->g2;
 
181
        {
 
182
            if (glyphkern->g2) {
 
183
                delete glyphkern->g2;
 
184
            }
172
185
            glyphkern->g2 = new GlyphNames(value);
173
186
            object->requestModified(SP_OBJECT_MODIFIED_FLAG);
174
187
             break;
175
 
        case SP_ATTR_K:
176
 
            number = helperfns_read_number(value);
 
188
        }
 
189
        case SP_ATTR_K:
 
190
        {
 
191
            double number = value ? g_ascii_strtod(value, 0) : 0;
177
192
            if (number != glyphkern->k){
178
193
                glyphkern->k = number;
179
194
                object->requestModified(SP_OBJECT_MODIFIED_FLAG);
180
195
            }
181
196
            break;
182
 
        default:
 
197
        }
 
198
        default:
 
199
        {
183
200
            if (((SPObjectClass *) (parent_class))->set) {
184
201
                ((SPObjectClass *) (parent_class))->set(object, key, value);
185
202
            }
186
203
            break;
 
204
        }
187
205
    }
188
206
}
189
207