Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/structs/drawing/blip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{
xml_read_loop,
},
structs::{
DrawingRelationship,
MediaObject,
raw::RawRelationships,
},
Expand Down Expand Up @@ -118,10 +119,10 @@ impl Blip {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// a:blip
let r_id = self.image.rid(rel_list);
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/blip_fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use crate::{
set_string_from_xml,
xml_read_loop,
},
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
writer::driver::{
write_end_tag,
write_start_tag,
Expand Down Expand Up @@ -192,10 +195,10 @@ impl BlipFill {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// a:blipFill
let mut attributes: crate::structs::AttrCollection = Vec::new();
Expand Down
7 changes: 5 additions & 2 deletions src/structs/drawing/graphic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ use quick_xml::{
use super::GraphicData;
use crate::{
reader::driver::xml_read_loop,
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
traits::AdjustmentCoordinateWithSheet,
writer::driver::{
write_end_tag,
Expand Down Expand Up @@ -82,7 +85,7 @@ impl Graphic {

pub(crate) fn write_to(
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'_>>,
) {
// a:graphic
write_start_tag(writer, "a:graphic", vec![], false);
Expand Down
9 changes: 6 additions & 3 deletions src/structs/drawing/graphic_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ use crate::{
},
xlsx::chart,
},
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
traits::AdjustmentCoordinateWithSheet,
writer::driver::{
write_end_tag,
Expand Down Expand Up @@ -95,7 +98,7 @@ impl GraphicData {

pub(crate) fn write_to(
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'_>>,
) {
// a:graphicData
write_start_tag(
Expand All @@ -106,7 +109,7 @@ impl GraphicData {
);

// c:chart
rel_list.push((String::from("CHART"), String::new()));
rel_list.push(DrawingRelationship::Chart);
write_start_tag(
writer,
"c:chart",
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/blip_fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use crate::{
set_string_from_xml,
xml_read_loop,
},
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
writer::driver::{
write_end_tag,
write_start_tag,
Expand Down Expand Up @@ -192,10 +195,10 @@ impl BlipFill {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:blipFill
let mut attributes: crate::structs::AttrCollection = Vec::new();
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/connection_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ use super::{
};
use crate::{
reader::driver::xml_read_loop,
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
writer::driver::{
write_end_tag,
write_start_tag,
Expand Down Expand Up @@ -194,10 +197,10 @@ impl ConnectionShape {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:cxnSp
write_start_tag(writer, "xdr:cxnSp", vec![("macro", "").into()], false);
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/graphic_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ use crate::{
set_string_from_xml,
xml_read_loop,
},
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
traits::AdjustmentCoordinateWithSheet,
writer::driver::{
write_end_tag,
Expand Down Expand Up @@ -195,10 +198,10 @@ impl GraphicFrame {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:graphicFrame
write_start_tag(
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/group_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ use super::{
};
use crate::{
reader::driver::xml_read_loop,
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
writer::driver::{
write_end_tag,
write_start_tag,
Expand Down Expand Up @@ -190,10 +193,10 @@ impl GroupShape {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:grpSp
write_start_tag(writer, "xdr:grpSp", vec![], false);
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/one_cell_anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ use super::{
};
use crate::{
reader::driver::xml_read_loop,
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
traits::AdjustmentCoordinate,
writer::driver::{
write_end_tag,
Expand Down Expand Up @@ -237,10 +240,10 @@ impl OneCellAnchor {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:oneCellAnchor
write_start_tag(writer, "xdr:oneCellAnchor", vec![], false);
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ use super::{
};
use crate::{
reader::driver::xml_read_loop,
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
writer::driver::{
write_end_tag,
write_start_tag,
Expand Down Expand Up @@ -151,10 +154,10 @@ impl Picture {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:pic
write_start_tag(writer, "xdr:pic", vec![], false);
Expand Down
7 changes: 4 additions & 3 deletions src/structs/drawing/spreadsheet/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::{
xml_read_loop,
},
structs::{
DrawingRelationship,
StringValue,
raw::RawRelationships,
},
Expand Down Expand Up @@ -237,10 +238,10 @@ impl Shape {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
ole_id: usize,
) {
// xdr:sp
Expand Down
11 changes: 7 additions & 4 deletions src/structs/drawing/spreadsheet/shape_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ use crate::{
set_string_from_xml,
xml_read_loop,
},
structs::raw::RawRelationships,
structs::{
DrawingRelationship,
raw::RawRelationships,
},
writer::driver::{
write_end_tag,
write_start_tag,
Expand Down Expand Up @@ -410,10 +413,10 @@ impl ShapeProperties {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:spPr
let mut attributes: crate::structs::AttrCollection = Vec::new();
Expand Down
7 changes: 4 additions & 3 deletions src/structs/drawing/spreadsheet/two_cell_anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::{
},
structs::{
BooleanValue,
DrawingRelationship,
raw::RawRelationships,
},
traits::{
Expand Down Expand Up @@ -385,10 +386,10 @@ impl TwoCellAnchor {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
ole_id: usize,
) {
if self.is_alternate_content() {
Expand Down
9 changes: 5 additions & 4 deletions src/structs/drawing/spreadsheet/worksheet_drawing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use crate::{
reader::driver::xml_read_loop,
structs::{
Chart,
DrawingRelationship,
Image,
OleObjects,
raw::RawRelationships,
Expand Down Expand Up @@ -510,11 +511,11 @@ impl WorksheetDrawing {
);
}

pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
ole_objects: &OleObjects,
rel_list: &mut Vec<(String, String)>,
ole_objects: &'a OleObjects,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
// xdr:wsDr
write_start_tag(
Expand Down
8 changes: 5 additions & 3 deletions src/structs/image.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use crate::structs::DrawingRelationship;

use std::{
fs,
fs::File,
Expand Down Expand Up @@ -409,10 +411,10 @@ impl Image {
}

#[inline]
pub(crate) fn write_to(
&self,
pub(crate) fn write_to<'a>(
&'a self,
writer: &mut Writer<Cursor<Vec<u8>>>,
rel_list: &mut Vec<(String, String)>,
rel_list: &mut Vec<DrawingRelationship<'a>>,
) {
if let Some(anchor) = self.two_cell_anchor() {
anchor.write_to(writer, rel_list, 0);
Expand Down
Loading