Repository navigation
Slide master and layout editing, Header & Footer (round 3, G5) - #13
Merged
Merged
Conversation
Layout.shapes and Master.shapes are the editable Shape a slide has, addressed L<n>.<id> / M<n>.<id> (sldLayoutId / sldMasterId less 2147483648, which PowerPoint keeps on save). deck.masters; set_prompt (hasCustomPrompt); find_text(scope=); set_footer as Insert > Header & Footer writes it, and new slides get the footers after Apply to All; add, duplicate, rename and delete layouts as Slide Master view does (a layout in use is refused); deleting a placeholder something inherits from is refused. All measured in PowerPoint 16. Tools: L/M addresses in the text and shape tools, the add tools on L2 / M0, checks.affects with checks on the affected slides, decks' stories on find_text/replace_text, describe lists masters, layout ids, prompts and their text, and the deferred ppt_edit_master. Undo by slide refuses a layout or master change (ooxml-edit 0.16.0's undo_shared). Golden p17. CI installs ooxml-edit from r3-master-layout-scope until uvrt/ooxml-edit#23 is merged (TEMPORARY (r3)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production feedback round 3, item G5: master and layout text (footer year and entity, legal text per language, prompt text) could not be found, replaced or edited. Full editing, as approved.
Library
deck.masters/deck.master()->Master(idM0,name,part_path,layouts,slides,shapes);Layoutgainsid(L2),master,type,slides,placeholder("body"),rename,duplicate,delete.Layout.shapes/Master.shapesreturn the sameShapea slide has (text, run/paragraph formatting, fill, move/resize, delete, replace_image), plusadd_shape,add_textbox,add_picture(SVG too),add_connector,add_table. AddressesL<n>.<id>/M<n>.<id>: n is thesldLayoutId/sldMasterIdless 2147483648. Measured: PowerPoint keeps these ids on save (it renumbers the parts), so they are as stable as a slide'ssldId; the local part is the slide scheme (stamp, creationId, cNvPr id).shape.set_prompt()/shape.prompt: first level written,hasCustomPrompt="1", levels kept -- measured: typing in a layout placeholder in Slide Master view sets it (whole text or first line).deck.find_text(..., scope="slides"|"layouts"|"masters"|"all"),outline_blocks(scope=).deck.set_footer(text, slide_number=, date="auto"|text|None, slides=, skip_title=)as Insert > Header & Footer writes it (measured, notes below);add_slideafter Apply to All copies the layout's footers, as New Slide does (measured).add_layout,duplicate_layout,rename_layout,delete_layout(reassign_to=)as Slide Master view does them; a layout in use is refused (PowerPoint disables Delete for it).shape.inherited_by(); deleting a layout/master placeholder something inherits from is refused with the list. Slides' own placeholder overrides are untouched.deck.affected_slides().Measured in PowerPoint for Mac 16 (nl UI)
ftrget the text,dtadatetime1field (or a run for fixed text); master<p:hf hdr="0"/>(off items="0", e.g. all offsldNum="0" hdr="0" ftr="0" dt="0"), aftersldLayoutIdLst;showSpecialPlsOnTitleSld="0"when not on the title slide; each slide getsdt,ftr,sldNumappended (ph type/sz/idx copied, emptyspPr,sldNumwith the layout's field id); turning off removes them from slides. Apply (one slide) leaves master and layouts alone.1_<name>, id max+1, master rel + content type. Insert Layout:preserve="1" userDrawn="1", no type, title + master's dt/ftr/sldNum. Rename:cSld@nameonly. Delete of an unused layout: part, rel, id entry.Tools
ppt_set_text,ppt_format_text,ppt_set_shape,ppt_arrangetakeL2.5/M0.7;ppt_add_shape/ppt_add_picture/ppt_add_connector/ppt_add_tabletakeslide: L2/M0. Every result haschecks.affects({"M0": ["s:256", ...]}) and its fit/collision/empty-placeholder checks run on those slides.find_text/replace_text: decks'stories=body(slides, default),layouts,masters,all(Undo by scope: shared parts; decks' stories on find/replace (round 3, G5) ooxml-edit#23). A replace that finds nothing on slides warns when the text is on a layout/master.describe:masters(id, name, non-placeholder text, footer), layouts withid, placeholder ids and custom prompts, non-placeholder text.ppt_edit_master(group ppt_slides):set_prompt,set_footer,add_layout,duplicate_layout,rename_layout,delete_layout.entangled(undo_shared, ooxml-edit 0.16.0). Tested.Budgets (offline proxy): core 3,398 -> 3,440 estimated (~5,029 -> ~5,091 counted, <= 5,500); every definition 11,309 -> 11,779 (guard 11,800). Strict set unchanged: replace_text, set_properties, ppt_add_table, ppt_add_slide, ppt_draft_slides, ppt_manage_slides; 29 free strings, 24 optional (only replace_text's
storiesenum/description grew). Online strict check not run.Golden p17: Example Corp's template made ready for 2027 in Dutch (master legal line, Dutch legal notice on a renamed layout, Dutch prompt, Header & Footer with slide numbers, not on the title slide); 8 calls, 18/18.
Office verification: p17 output and a wider verify deck (duplicated/added/deleted/reassigned layouts, SVG logo on the master) open unprompted, export to PDF with the edits on every page, survive a PowerPoint save with ids, prompts,
p:hfandshowSpecialPlsOnTitleSldkept; Normal view shows "Typ hier uw bevinding" in an empty placeholder; Slide Master view shows the Dutch notice, footer and legal line.Docs: SUPPORTED.md (master/layout editing supported), GUIDANCE.md (when to edit masters vs slides,
affects), USAGE.md, tools README, CHANGELOG.CI installs ooxml-edit from
r3-master-layout-scope(# TEMPORARY (r3)); merge uvrt/ooxml-edit#23 first, then switch the pin back to@main.🤖 Generated with Claude Code
https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh