[librsvg: 1/7] Add a NodeData::get_chars() function



commit 7d1e3837ea9f6ef58549a6de5baa0e8736d196e2
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Mar 11 10:42:59 2020 -0600

    Add a NodeData::get_chars() function
    
    We'll be changing the internal representation of the "chars" node
    vs. other real SVG element types.  So, instead of the usual
    .get_impl::<NodeChars>() we'll have this explicit function.

 rsvg_internals/src/node.rs | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index e5bb0d6f..877a2744 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -30,6 +30,7 @@ use crate::parsers::Parse;
 use crate::properties::{ComputedValues, SpecifiedValue, SpecifiedValues};
 use crate::property_bag::PropertyBag;
 use crate::property_defs::Overflow;
+use crate::text::NodeChars;
 use crate::transform::Transform;
 
 /// Strong reference to an element in the SVG tree.
@@ -98,6 +99,10 @@ impl NodeData {
         self.node_type
     }
 
+    pub fn get_chars(&self) -> &NodeChars {
+        self.get_impl::<NodeChars>()
+    }
+
     pub fn element_name(&self) -> &QualName {
         &self.element_name
     }


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