Review follow-up on #1658 (CodeRabbit), both from storing the slide's
mapped scheme in 30ccc38e:
- Copying in Slide Master view used the current slide's colour map. Use
`ctx_for`, so the theme is that of what is being edited.
- `ColorScheme` shares an entry between `dk1` and `tx1`, so a mapped scheme
changed direct `dk1` colours too: a dark fill pasted white. `SourceTheme`
keeps the theme's colours and the map apart, and `bake_theme` maps only
`tx1`, `bg1`, `tx2` and `bg2`, as `Ctx::color` does.
The browser image test now checks that non-picture pastes keep their text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up on #1658 (CodeRabbit): `source_theme` stored the master's
scheme, so a slide or layout that overrides the colour map had its colours
fixed through the wrong map. Detaching made this reach a placeholder's
inherited colours: a title drawn white under an override pasted black.
Store the scheme the slide draws with. Paste as Picture reads the same
value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up on #1658:
- The drag duplicate cleared `ph` without detaching, so a title or body
dragged off with Alt lost its size and bullets. Copy, Duplicate and the
drag now share `detach_on_slide`.
- Detaching at copy time turned a slide placeholder pasted in Slide Master
view into a regular shape. The clipboard keeps the originals, and a paste
there takes them, so it stays a placeholder as before this PR. Keep
Source Formatting bakes them too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while testing crates/engine/src/cmd/file.rs:489 (save, with save_bytes at :341-349 and format_for_path at :440)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Found while testing crates/engine/src/cmd/design/master_view.rs:8 (master_view; `master` read via usize_param, `layout` at :14)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Found while testing crates/engine/src/cmd/file.rs:362 (pdf_options) with crates/pdf/src/lib.rs:364-371 (handout_boxes)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review follow-up (CodeRabbit on #1658):
- Text levels are resolved before the copy's style changes. A master
placeholder's font reference reached the copy's text (body font in an
accent colour for a title) although the original ignores it: text only
takes the shape's or the layout placeholder's font reference.
- Fill, line and effects come from where `resolve::fill`, `resolve::line`
and `resolve::effects` take them: the first shape in the chain with an
explicit value or a style. A layout's (or the slide's own) style no
longer loses to an explicit fill, line or effect on the master. The
copy gets one style whose references each come from the shape that
supplied that property; unused references are neutral.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A placeholder copied or duplicated on a slide became a regular shape by
clearing `ph`, which also dropped everything it inherited from its layout
and master: the title's 44 pt heading font, the body's bullets and indent
levels, autofit and the box. Without `ph` the text fell back to the
presentation's default style (18 pt, no bullets), on Ctrl+V and the
context menu alike.
`resolve::detach_placeholder` makes the inherited box, fill, line,
effects, body properties and every level's text style the shape's own
before `ph` is cleared. Theme references stay references, so the default
paste still follows the destination theme. Copy (so Cut and pasting into
another deck work after the source is gone) and Duplicate use it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while testing crates/engine/src/spell.rs:693 (paragraph_words, the `inside` closure)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>