[librsvg: 11/22] handle::load_extern(): Take a LoadOptions, not a whole handle
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 11/22] handle::load_extern(): Take a LoadOptions, not a whole handle
- Date: Tue, 8 Jan 2019 17:54:08 +0000 (UTC)
commit e4b0f1218d1300ed1c162b1b96d9ab376e489b0b
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jan 7 19:57:45 2019 -0600
handle::load_extern(): Take a LoadOptions, not a whole handle
rsvg_internals/src/defs.rs | 3 ++-
rsvg_internals/src/handle.rs | 6 ++----
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/defs.rs b/rsvg_internals/src/defs.rs
index 3f4271d2..151e1064 100644
--- a/rsvg_internals/src/defs.rs
+++ b/rsvg_internals/src/defs.rs
@@ -44,7 +44,8 @@ impl Defs {
match self.externs.entry(aurl) {
Entry::Occupied(e) => Ok(*(e.get())),
Entry::Vacant(e) => {
- let extern_handle = handle::load_extern(handle, e.key())?;
+ let load_options = handle::get_load_options(handle);
+ let extern_handle = handle::load_extern(&load_options, e.key())?;
e.insert(extern_handle);
Ok(extern_handle)
}
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 099350aa..830d40c7 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -559,15 +559,13 @@ pub fn lookup_fragment_id(handle: *const RsvgHandle, id: &str) -> Option<Rc<Node
svg.lookup_node_by_id(id)
}
-pub fn load_extern(handle: *const RsvgHandle, aurl: &AllowedUrl) -> Result<*const RsvgHandle, ()> {
+pub fn load_extern(load_options: &LoadOptions, aurl: &AllowedUrl) -> Result<*const RsvgHandle, ()> {
unsafe {
- let rhandle = get_rust_handle(handle);
-
let file = GFile::new_for_uri(aurl.url().as_str());
let res = rsvg_handle_new_from_gfile_sync(
file.to_glib_none().0,
- rhandle.load_options.get().to_flags(),
+ load_options.to_flags(),
ptr::null(),
ptr::null_mut(),
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]