[librsvg] fix compile error without libcroco.



commit 991096b7d389302b2209ab8bd59b334e1a3422ea
Author: Hiroyuki Ikezoe <hiikezoe gnome org>
Date:   Thu Apr 29 20:45:08 2010 +0900

    fix compile error without libcroco.

 rsvg-styles.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index 8e3aeb4..3b3cf92 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -1126,6 +1126,7 @@ rsvg_real_parse_cssbuffer (RsvgHandle * ctx, const char *buff, size_t buflen)
 
     while (loc < buflen) {
         gchar **selectors;
+        gchar **styles;
         guint i;
         GString *selector = g_string_new (NULL);
         GString *style_props = g_string_new (NULL);
@@ -1160,13 +1161,24 @@ rsvg_real_parse_cssbuffer (RsvgHandle * ctx, const char *buff, size_t buflen)
         }
 
         selectors = g_strsplit (selector->str, ",", -1);
+        styles = g_strsplit (style_props->str, ";", -1);
         for (i = 0; i < g_strv_length (selectors); i++) {
-            rsvg_css_define_style (ctx,
-                                   g_strstrip (selectors[i]),
-                                   style_props->str,
-                                   FALSE);
+            guint j;
+            for (j = 0; j < g_strv_length (styles); j++) {
+                gchar **values;
+                values = g_strsplit (styles[j], ":", 2);
+                if (g_strv_length (values) == 2) {
+                    rsvg_css_define_style (ctx,
+                                           g_strstrip (selectors[i]),
+                                           g_strstrip (values[0]),
+                                           g_strstrip (values[1]),
+                                           FALSE);
+                }
+                g_strfreev (values);
+            }
         }
         g_strfreev (selectors);
+        g_strfreev (styles);
 
         g_string_free (selector, TRUE);
         g_string_free (style_props, TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]