Text boxes: their typefaces count as used workbook fonts, so an installed one is bound; restore image_ext's doc comment (review fix-up for #401)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-11 16:14:41 -04:00
co-authored by Claude Opus 5.5
parent 1c3beb2a95
commit 3054babe0e
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -300,6 +300,8 @@ impl SheetApp {
names.extend(d.wb.styles.iter().map(|(_, s)| s.font.name.clone()));
names.push(d.wb.theme.major_font.clone());
names.push(d.wb.theme.minor_font.clone());
// Text boxes and shapes name their own typefaces.
names.extend(d.wb.sheets.iter().flat_map(|sh| sh.shapes.iter().filter_map(|s| s.format.font.clone())));
}
names
}
+1 -1
View File
@@ -433,7 +433,6 @@ pub fn write_drawing(sheet: &Sheet, theme: &Theme, objs: &[Obj<'_>]) -> String {
s
}
/// File extension for an image MIME type.
/// A text run's `a:rPr` attributes (size, bold, italic) and children in schema order (outline,
/// fill, typeface).
fn run_props(f: &ShapeFormat, theme: &Theme) -> (String, String) {
@@ -463,6 +462,7 @@ fn run_props(f: &ShapeFormat, theme: &Theme) -> (String, String) {
(attrs, body)
}
/// File extension for an image MIME type.
pub fn image_ext(mime: &str, data: &[u8]) -> &'static str {
match mime.to_ascii_lowercase().as_str() {
"image/png" => "png",