~ubuntu-branches/ubuntu/utopic/geany/utopic

« back to all changes in this revision

Viewing changes to plugins/htmlchars.c

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2011-12-10 07:43:26 UTC
  • mfrom: (3.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20111210074326-s8yqbew5i20h33tf
Tags: 0.21-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  - debian/patches/20_use_evince_viewer.patch:
     + use evince as viewer for pdf and dvi files
  - debian/patches/20_use_x_terminal_emulator.patch:
     + use x-terminal-emulator as terminal
  - debian/control
     + Add breaks on geany-plugins-common << 0.20
* Also fixes bugs:
  - Filter for MATLAB/Octave files filters everythign (LP: 885505)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *      htmlchars.c - this file is part of Geany, a fast and lightweight IDE
3
3
 *
4
 
 *      Copyright 2009-2010 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
5
 
 *      Copyright 2006-2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
6
 
 *      Copyright 2007-2010 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
 
4
 *      Copyright 2009-2011 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
 
5
 *      Copyright 2006-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
 
6
 *      Copyright 2007-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7
7
 *
8
8
 *      This program is free software; you can redistribute it and/or modify
9
9
 *      it under the terms of the GNU General Public License as published by
20
20
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21
21
 *      MA 02110-1301, USA.
22
22
 *
23
 
 * $Id: htmlchars.c 5354 2010-11-02 13:05:12Z ntrel $
 
23
 * $Id: htmlchars.c 5882 2011-08-03 15:20:26Z colombanw $
24
24
 */
25
25
 
26
26
/* HTML Characters plugin (Inserts HTML character entities like '&amp;') */
27
27
 
 
28
#ifdef HAVE_CONFIG_H
 
29
#       include "config.h"
 
30
#endif
 
31
 
28
32
#include "geanyplugin.h"
29
33
#include <string.h>
30
34
#include "SciLexer.h"
649
653
 
650
654
        if (doc != NULL && sci_has_selection(doc->editor->sci))
651
655
        {
652
 
                guint selection_len;
 
656
                gsize selection_len;
653
657
                gchar *selection;
654
658
                GString *replacement = g_string_new(NULL);
655
 
                guint i;
 
659
                gsize i;
656
660
                gchar *new;
657
661
                const gchar *entity = NULL;
658
662
                gchar buf[7];
664
668
                for (i = 0; i < selection_len; i++)
665
669
                {
666
670
                        len = g_unichar_to_utf8(g_utf8_get_char(selection + i), buf);
667
 
                        i = len - 1 + i;
 
671
                        i = (guint)len - 1 + i;
668
672
 
669
673
                        buf[len] = '\0';
670
674
                        entity = get_entity(buf);