Enlightenment CVS committal

Author  : azundris
Project : misc
Module  : erss

Dir     : misc/erss/src


Modified Files:
        erss.c parse.c tooltip.c 


Log Message:
* remove potential tags from tooltips

===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/erss.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- erss.c      18 Feb 2004 19:33:04 -0000      1.35
+++ erss.c      20 Feb 2004 13:36:54 -0000      1.36
@@ -1,7 +1,6 @@
 #include "erss.h"
 #include "parse.h"
 #include "parse_config.h"
-#include "tooltip.h"
 
 Evas *evas = NULL;
 Ecore_Evas *ee = NULL;
@@ -451,7 +450,6 @@
        int got_rc_file = FALSE;
        char config_file[PATH_MAX];
        char theme_file[PATH_MAX];
-   XWindowChanges xwc;
 
        struct stat statbuf;
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/parse.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- parse.c     3 Feb 2004 14:41:10 -0000       1.23
+++ parse.c     20 Feb 2004 13:36:54 -0000      1.24
@@ -83,14 +83,14 @@
                                str = xmlNodeListGetString(doc, cur->xmlChildrenNode, 
1);
 
                                tt = erss_tooltip_new (str);
-               
+
                                if (item->obj) {
                                        evas_object_event_callback_add (item->obj,
                                                        EVAS_CALLBACK_MOUSE_IN, 
erss_tooltip_mouse_in, tt);
                                        evas_object_event_callback_add (item->obj,
                                                        EVAS_CALLBACK_MOUSE_OUT, 
erss_tooltip_mouse_out, tt);
                                }
-                               
+
                                xmlFree (str);
                        }
                }
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/tooltip.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- tooltip.c   18 Feb 2004 19:33:04 -0000      1.4
+++ tooltip.c   20 Feb 2004 13:36:54 -0000      1.5
@@ -3,6 +3,32 @@
 #include "parse_config.h"
 #include "tooltip.h"
 
+char *erss_tooltip_clean (char *description) {
+       /* remove potential tags. not using libXML here, contents may not
+          be well-formed...  */
+
+       char *p;
+
+       
if((description==NULL)||(*description=='\0')||((description=strdup(description))==NULL))
+               return NULL;
+
+       p=description;
+       while(*p) {
+         if(*p=='<') {
+           char *p2=p;
+           do {
+             p2++;
+           } while(*p2&&(*p2!='>'));
+           if(*p2)
+             memmove(p,p2+1,strlen(p2));
+           else
+             *p='\0'; }
+         else
+           p++; }
+
+       return description;
+}
+
 void erss_window_move_tooltip (Ecore_Evas * ee)
 {
        int x, y, w, h;
@@ -19,6 +45,10 @@
        Erss_Tooltip *tt;
        int x, y, w, h;
        double ew, eh;
+       char *text = erss_tooltip_clean(description);
+
+       if(text == NULL)
+               return NULL;
        
        tt = malloc (sizeof (Erss_Tooltip));
        memset (tt, 0, sizeof (Erss_Tooltip));
@@ -59,7 +89,7 @@
        etox_set_word_wrap(tt->etox, 1);
        etox_set_alpha(tt->etox, 255);
        evas_object_layer_set(tt->etox, 1000);
-       etox_set_text (tt->etox, description);
+       etox_set_text (tt->etox, text);
        evas_object_show (tt->etox);
        evas_object_geometry_get(tt->etox, NULL, NULL, &ew, &eh);
 
@@ -75,6 +105,8 @@
        ecore_evas_callback_resize_set(tt->ee, erss_window_resize);
        ecore_evas_resize(tt->ee, ew + 10, eh + 10);
 
+       free(text);
+
        return tt;
 }
 




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to