[librsvg: 91/95] NodeSvg: Parse delayed attributes with the PHF



commit 6254e2933b2e1f0be3b199556c5ad607b76bffea
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Feb 21 18:18:53 2018 -0600

    NodeSvg: Parse delayed attributes with the PHF

 rust/src/structure.rs | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/rust/src/structure.rs b/rust/src/structure.rs
index f4388930..cc464102 100644
--- a/rust/src/structure.rs
+++ b/rust/src/structure.rs
@@ -468,8 +468,18 @@ pub extern fn rsvg_node_svg_apply_atts (raw_node: *const RsvgNode, handle: *cons
         if let Some(owned_pbag) = svg.pbag.borrow().as_ref() {
             let pbag = PropertyBag::from_owned(&owned_pbag);
 
-            let class = pbag.lookup("class").map(|(_, v)| v);
-            let id = pbag.lookup("id").map(|(_, v)| v);
+            let mut class = None;
+            let mut id = None;
+
+            for (_key, attr, value) in pbag.iter() {
+                match attr {
+                    Attribute::Class => class = Some(value),
+
+                    Attribute::Id => id = Some(value),
+
+                    _ => (),
+                }
+            }
 
             let c_class = class.to_glib_none ();
             let c_id = id.to_glib_none ();


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