]> git.sesse.net Git - vlc/commitdiff
Use resolve_xml_special_chars where appropriate.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 22 Sep 2008 22:04:18 +0000 (00:04 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 22 Sep 2008 22:04:18 +0000 (00:04 +0200)
(noticed by Antoine Cellerier)

modules/misc/freetype.c
modules/misc/quartztext.c
modules/misc/text_renderer.h

index f27fefe5aff7c959cb6d75851f01da9d8688f81f..0ea7f3473a6469a29277837bb549c6e362b1af69 100644 (file)
@@ -40,6 +40,7 @@
 #include <vlc_stream.h>
 #include <vlc_xml.h>
 #include <vlc_input.h>
+#include <vlc_strings.h>
 
 #include <math.h>
 #include <errno.h>
index 9521efa06815053b3373254ecc51eb25120bb5fb..147ed3a432ea3552cda604cdea2acc2745fc6e4f 100644 (file)
@@ -38,6 +38,7 @@
 #include <vlc_stream.h>
 #include <vlc_xml.h>
 #include <vlc_input.h>
+#include <vlc_strings.h>
 
 #include <math.h>
 
index 5b6e07551e49ffbe9b311b13e830e1ec0382b8b1..fa5d098e63911ed94a857378879a10a0954a7acc 100644 (file)
@@ -494,39 +494,6 @@ static void HandleWhiteSpace( char *psz_node )
 }
 
 /* */
-static void HandleMarkup( char *psz_node )
-{
-    static const struct
-    {
-        const char *psz_pattern;
-        char i_char;
-    } p_replace[] = {
-        { "&lt;",   '<' },
-        { "&gt;",   '>' },
-        { "&amp;",  '&' },
-        { "&quot;", '"' },
-        /* This one will always match */
-        { "&",      '&' }
-    };
-
-    char *s = psz_node;
-    while( ( s = strchr( s, '&' ) ) != NULL )
-    {
-        size_t i_size;
-        int i;
-        for( i = 0; ; i++ )
-        {
-            i_size = strlen(p_replace[i].psz_pattern);
-            if( !strncmp( s, p_replace[i].psz_pattern, i_size ) )
-                break;
-        }
-        if( i_size > 1 )
-            memmove( &s[1], &s[i_size],
-                     strlen( s ) - i_size + 1 );
-        *s++ = p_replace[i].i_char;
-    }
-}
-
 static int ProcessNodes( filter_t *p_filter,
                          xml_reader_t *p_xml_reader,
                          text_style_t *p_font_style,
@@ -654,7 +621,7 @@ static int ProcessNodes( filter_t *p_filter,
                 {
                     /* */
                     HandleWhiteSpace( psz_node );
-                    HandleMarkup( psz_node );
+                    resolve_xml_special_chars( psz_node );
 
                     SetupLine( p_filter, psz_node, &psz_text,
                                pi_runs, ppi_run_lengths, ppp_styles,