[librsvg: 1/5] svg: create Defs internally to Svg
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/5] svg: create Defs internally to Svg
- Date: Sat, 12 Jan 2019 02:01:56 +0000 (UTC)
commit d8262af3d44a4a76802d91a4917ee9881b61db5a
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Jan 11 20:47:02 2019 +0100
svg: create Defs internally to Svg
rsvg_internals/src/svg.rs | 3 +--
rsvg_internals/src/xml.rs | 4 ----
2 files changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs
index eb9a81d2..8dd32ce0 100644
--- a/rsvg_internals/src/svg.rs
+++ b/rsvg_internals/src/svg.rs
@@ -35,14 +35,13 @@ impl Svg {
pub fn new(
handle: *mut RsvgHandle,
tree: Tree,
- defs: Defs,
ids: HashMap<String, RsvgNode>,
css_styles: CssStyles,
) -> Svg {
Svg {
handle,
tree,
- defs: RefCell::new(defs),
+ defs: RefCell::new(Defs::new()),
ids,
css_styles,
}
diff --git a/rsvg_internals/src/xml.rs b/rsvg_internals/src/xml.rs
index f9d170c6..26f49b04 100644
--- a/rsvg_internals/src/xml.rs
+++ b/rsvg_internals/src/xml.rs
@@ -11,7 +11,6 @@ use allowed_url::AllowedUrl;
use attributes::Attribute;
use create_node::create_node_and_register_id;
use css::CssStyles;
-use defs::Defs;
use error::LoadingError;
use handle::{self, RsvgHandle};
use io;
@@ -71,7 +70,6 @@ extern "C" {
/// what creates normal graphical elements.
pub struct XmlState {
tree: Option<Tree>,
- defs: Option<Defs>,
ids: Option<HashMap<String, RsvgNode>>,
css_styles: Option<CssStyles>,
context_stack: Vec<Context>,
@@ -98,7 +96,6 @@ impl XmlState {
pub fn new(handle: *mut RsvgHandle) -> XmlState {
XmlState {
tree: None,
- defs: Some(Defs::new()),
ids: Some(HashMap::new()),
css_styles: Some(CssStyles::new()),
context_stack: vec![Context::Start],
@@ -132,7 +129,6 @@ impl XmlState {
Svg::new(
self.handle,
self.tree.take().unwrap(),
- self.defs.take().unwrap(),
self.ids.take().unwrap(),
self.css_styles.take().unwrap(),
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]