~joel-auterson/ubuntu/maverick/ibus/newmenuname

« back to all changes in this revision

Viewing changes to src/ibustext.c

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-10-05 20:45:18 UTC
  • mfrom: (1.1.5 upstream) (6.1.15 sid)
  • Revision ID: james.westby@ubuntu.com-20091005204518-069vlwrl3r8v7bbr
Tags: 1.2.0.20090927-2
* create po template when build (LP: #188690)
  - debian/rules: updated.
  - debian/clean: remove pot file when clean.
* debian/control: build depends on python-rsvg (LP: #432375)

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
        return NULL;
242
242
 
243
243
    text= g_object_new (IBUS_TYPE_TEXT, NULL);
244
 
 
 
244
    text->is_static = FALSE;
245
245
    text->text = (gchar *)str;
246
246
 
247
247
    return text;
259
259
 
260
260
    text= g_object_new (IBUS_TYPE_TEXT, NULL);
261
261
 
 
262
    text->is_static = FALSE;
262
263
    text->text = (gchar *)g_malloc (12);
263
264
    len = g_unichar_to_utf8 (c, text->text);
264
265
    text->text[len] =  0;
275
276
{
276
277
    g_assert (IBUS_IS_TEXT (text));
277
278
 
 
279
    IBusAttribute *attr;
 
280
 
278
281
    if (end_index < 0) {
279
282
        end_index  += g_utf8_strlen(text->text, -1) + 1;
280
283
    }
281
284
 
282
 
    if (end_index <= 0)
 
285
    if (end_index <= 0) {
283
286
        return;
 
287
    }
284
288
 
285
 
    if (text->attrs == NULL)
 
289
    if (text->attrs == NULL) {
286
290
        text->attrs = ibus_attr_list_new ();
 
291
    }
287
292
 
288
 
    ibus_attr_list_append (text->attrs, ibus_attribute_new (type, value, start_index, end_index));
 
293
    attr = ibus_attribute_new (type, value, start_index, end_index);
 
294
    ibus_attr_list_append (text->attrs, attr);
 
295
    g_object_unref (attr);
289
296
}
290
297
 
291
298
guint