UPDATE: Dump of initial files

This commit is contained in:
Nicolás Hatcher
2023-11-18 21:26:18 +01:00
commit c5b8efd83d
279 changed files with 42654 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
use ironcalc_base::types::Workbook;
use super::xml_constants::{XML_DECLARATION, XML_WORKSHEET};
pub(crate) fn get_workbook_xml_rels(workbook: &Workbook) -> String {
let mut relationships_str: Vec<String> = vec![];
let worksheet_count = workbook.worksheets.len() + 1;
for id in 1..worksheet_count {
relationships_str.push(format!(
"<Relationship Id=\"rId{id}\" Type=\"{XML_WORKSHEET}\" Target=\"worksheets/sheet{id}.xml\"/>"
));
}
let mut id = worksheet_count;
relationships_str.push(
format!("<Relationship Id=\"rId{id}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>")
);
id += 1;
relationships_str.push(
format!("<Relationship Id=\"rId{id}\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>")
);
format!(
"{XML_DECLARATION}\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">{}</Relationships>",
relationships_str.join("")
)
}