Reuse: a remapped table style's own XML carries its new id; checklist row name kept

This commit is contained in:
Brandon Thomas committed 2026-11-03 08:51:44 -05:00
1 parent 63531e2a6a
commit a6e2b64875
2 files changed
+8 -2

No files matched your search

+7 -1
View File
@@ -224,6 +224,8 @@ fn import_table_styles(cmd: &str, doc: &mut Presentation, src: &Presentation, us
break candidate;
}
};
// The definition's own XML names it too, and PPTX export writes that XML as is.
imported.raw = imported.raw.replacen(&format!("styleId=\"{}\"", source.id), &format!("styleId=\"{candidate}\""), 1);
imported.id.clone_from(&candidate);
map.insert(key, candidate);
} else {
@@ -481,7 +483,11 @@ mod tests {
assert_eq!(first_table_style(&doc.slides.first().expect("destination slide").shapes).as_deref(), Some(CUSTOM_STYLE));
let imported_style = first_table_style(&doc.slides.get(1).expect("reused slide").shapes).expect("grouped table style");
assert_ne!(imported_style, CUSTOM_STYLE);
assert!(doc.table_styles.iter().any(|style| style.id == imported_style && style.raw.contains("FF0000")));
assert!(
doc.table_styles.iter().any(|style| style.id == imported_style
&& style.raw.contains("FF0000")
&& style.raw.contains(&format!("styleId=\"{imported_style}\"")))
);
assert!(doc.table_styles.iter().any(|style| style.id == CUSTOM_STYLE && style.raw.contains("0000FF")));
}
+1 -1
View File
@@ -74,7 +74,7 @@ Open P0 items: Contextual tabs (Shape Format, Picture Format, Table Design/Layou
| Files | Export video (MP4) / animated GIF (GIF: one frame per slide, no transitions; no video) | P2 | P |
| Files | Print (slides, handouts, notes, outline) | P1 | M |
| Files | Password protection | P2 | M |
| Files | Reuse slides from another file (including referenced custom table styles) | P1 | P |
| Files | Reuse slides from another file | P1 | P |
| Files | Drag and drop files onto the window | P1 | D |
| Files | OpenDocument .odp open/save | P2 | M |
| Slides | New slide by layout | P0 | D |