[librsvg] rsvg_parse_style_attrs(): Take a full RsvgNode, not an RsvgState



commit 882265e5bfccf0d8227ee3d2cfe3fb3fef374fcc
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Mar 16 07:37:10 2017 -0600

    rsvg_parse_style_attrs(): Take a full RsvgNode, not an RsvgState

 rsvg-base.c      |    2 +-
 rsvg-structure.c |    2 +-
 rsvg-styles.c    |    9 ++++++---
 rsvg-styles.h    |    2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index fd24a10..f138cd7 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -396,7 +396,7 @@ node_set_atts (RsvgNode * node, RsvgHandle * ctx, const NodeCreator *creator, Rs
             else
                 klazz = NULL;
 
-            rsvg_parse_style_attrs (ctx, rsvg_node_get_state (node), creator->element_name, klazz, id, atts);
+            rsvg_parse_style_attrs (ctx, node, creator->element_name, klazz, id, atts);
         }
     }
 }
diff --git a/rsvg-structure.c b/rsvg-structure.c
index b09c746..bc85b7f 100644
--- a/rsvg-structure.c
+++ b/rsvg-structure.c
@@ -256,7 +256,7 @@ _rsvg_node_svg_apply_atts (RsvgNode *node, RsvgNodeSvg *svg, RsvgHandle *ctx)
             klazz = value;
         if ((value = rsvg_property_bag_lookup (svg->atts, "id")))
             id = value;
-        rsvg_parse_style_attrs (ctx, rsvg_node_get_state (node), "svg", klazz, id, svg->atts);
+        rsvg_parse_style_attrs (ctx, node, "svg", klazz, id, svg->atts);
     }
 }
 
diff --git a/rsvg-styles.c b/rsvg-styles.c
index 6cdf3a8..6b04357 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -1482,7 +1482,7 @@ rsvg_lookup_apply_css_style (RsvgHandle * ctx, const char *target, RsvgState * s
 /**
  * rsvg_parse_style_attrs:
  * @ctx: Rsvg context.
- * @state: Rsvg state
+ * @node: Rsvg node whose state should be modified
  * @tag: (nullable): The SVG tag we're processing (eg: circle, ellipse), optionally %NULL
  * @klazz: (nullable): The space delimited class list, optionally %NULL
  * @atts: Attributes in SAX style.
@@ -1491,14 +1491,17 @@ rsvg_lookup_apply_css_style (RsvgHandle * ctx, const char *target, RsvgState * s
  * stack.
  **/
 void
-rsvg_parse_style_attrs (RsvgHandle * ctx,
-                        RsvgState * state,
+rsvg_parse_style_attrs (RsvgHandle *ctx,
+                        RsvgNode *node,
                         const char *tag, const char *klazz, const char *id, RsvgPropertyBag * atts)
 {
     int i = 0, j = 0;
     char *target = NULL;
     gboolean found = FALSE;
     GString *klazz_list = NULL;
+    RsvgState *state;
+
+    state = rsvg_node_get_state (node);
 
     if (rsvg_property_bag_size (atts) > 0)
         rsvg_parse_style_pairs (ctx, state, atts);
diff --git a/rsvg-styles.h b/rsvg-styles.h
index 1cfa825..4ba3b67 100644
--- a/rsvg-styles.h
+++ b/rsvg-styles.h
@@ -227,7 +227,7 @@ void rsvg_parse_style           (RsvgHandle * ctx, RsvgState * state, const char *str)
 G_GNUC_INTERNAL
 void rsvg_parse_cssbuffer   (RsvgHandle * ctx, const char *buff, size_t buflen);
 G_GNUC_INTERNAL
-void rsvg_parse_style_attrs (RsvgHandle * ctx, RsvgState * state, const char *tag,
+void rsvg_parse_style_attrs (RsvgHandle *ctx, RsvgNode *node, const char *tag,
                              const char *klazz, const char *id, RsvgPropertyBag * atts);
 
 G_GNUC_INTERNAL


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