[librsvg: 51/95] rsvg_parse_presentation_attributes(): Use iteration instead of rsvg_property_bag_enumerate()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 51/95] rsvg_parse_presentation_attributes(): Use iteration instead of rsvg_property_bag_enumerate()
- Date: Thu, 22 Feb 2018 03:17:25 +0000 (UTC)
commit cdb4156e775aa42a8e6aa9037bd3e8250c6744e8
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Feb 20 19:13:51 2018 -0600
rsvg_parse_presentation_attributes(): Use iteration instead of rsvg_property_bag_enumerate()
rsvg-styles.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index 900089b5..8e3fa74f 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -1173,22 +1173,21 @@ rsvg_parse_style_pair (RsvgState * state,
}
}
-static void
-atts_enumerate_cb (const char *key, const char *value, gpointer data)
-{
- RsvgState *state = data;
-
- rsvg_parse_style_pair (state, key, value, FALSE, PAIR_SOURCE_PRESENTATION_ATTRIBUTE);
-}
-
-
/* take a pair of the form (fill="#ff00ff") and parse it as a style */
void
rsvg_parse_presentation_attributes (RsvgState * state, RsvgPropertyBag * atts)
{
- rsvg_property_bag_enumerate (atts,
- atts_enumerate_cb,
- state);
+ RsvgPropertyBagIter *iter;
+ const char *key;
+ const char *value;
+
+ iter = rsvg_property_bag_iter_begin (atts);
+
+ while (rsvg_property_bag_iter_next (iter, &key, &value)) {
+ rsvg_parse_style_pair (state, key, value, FALSE, PAIR_SOURCE_PRESENTATION_ATTRIBUTE);
+ }
+
+ rsvg_property_bag_iter_end (iter);
{
/* TODO: this conditional behavior isn't quite correct, and i'm not sure it should reside here */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]