Skip to content

Fix phantom slideMaster overrides and notesMaster placeholders triggering PowerPoint repair (#1443, #1444)#1458

Open
rupivbluegreen wants to merge 1 commit into
gitbrent:masterfrom
rupivbluegreen:fix/ooxml-repair-batch-2
Open

Fix phantom slideMaster overrides and notesMaster placeholders triggering PowerPoint repair (#1443, #1444)#1458
rupivbluegreen wants to merge 1 commit into
gitbrent:masterfrom
rupivbluegreen:fix/ooxml-repair-batch-2

Conversation

@rupivbluegreen
Copy link
Copy Markdown

Change Summary

Follow-up to #1457. Fixes two more OOXML schema/structure issues in src/gen-xml.ts that cause PowerPoint to show the "found a problem with content" repair dialog on every generated deck.

Change Type

  • Bug fix
  • New feature
  • Documentation update

Related Issues

Motivation and Context

Every multi-slide deck triggers the PowerPoint repair dialog because:

  1. [Content_Types].xml declares slideMaster1.xml, slideMaster2.xml, ..., slideMasterN.xml — but only slideMaster1.xml is ever written to the archive. The phantom references fail content-type validation. ([BUG] Content_Types.xml references phantom slideMaster entries for multi-slide presentations #1444)
  2. The notesMaster ships with 6 placeholder shapes that PowerPoint considers invalid and removes during the repair pass. The repaired notesMaster keeps only <p:bg>, an empty <p:spTree>, <p:clrMap>, and <p:notesStyle>. ([BUG] notesMaster placeholder shapes are removed by PowerPoint repair #1443)

Change Description

#1444makeXmlContTypes() (gen-xml.ts:1406)

Move the slideMaster1.xml Override out of the per-slide loop so it's emitted exactly once:

+strXml += '<Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType=".../slideMaster+xml"/>'
 slides.forEach((slide, idx) => {
-    strXml += `<Override PartName="/ppt/slideMasters/slideMaster${idx + 1}.xml" ContentType=".../slideMaster+xml"/>`
     strXml += `<Override PartName="/ppt/slides/slide${idx + 1}.xml" ContentType=".../slide+xml"/>`
     ...
 })

#1443makeXmlNotesMaster() (gen-xml.ts:1591)

Replace the 6 hand-written placeholder shapes with the minimal structure PowerPoint produces after the repair pass — only <p:bg>, an empty <p:spTree>, <p:clrMap>, and <p:notesStyle> remain.

Compatibility note: per-slide notesSlide files (makeXmlNotesSlide) continue to declare their own placeholder shapes (sldImg, body, sldNum), so any deck that contains speaker notes will still render them. The notesMaster's previous placeholder shapes were design-time scaffolding for the notes view; functionally, removing them produces the same file PowerPoint creates after repair.

Verification

Built locally with npm run build and ran a script that generates a 5-slide deck and inspects the produced XML:

PASS  #1444 exactly one slideMaster Override (got 1)
PASS  #1444 all 5 slide Overrides still present (got 5)
PASS  #1443 notesMaster has no placeholder <p:sp> shapes (got 0)
PASS  #1443 notesMaster retains <p:notesStyle>
PASS  #1443 notesMaster retains <p:clrMap>

On master (without the fix) the same script reports 5 phantom slideMaster Overrides and 6 placeholder shapes — matching the issue reports exactly.

npx eslint src/gen-xml.ts passes clean.

Checklist

  • Style guidelines followed (tabs, single quotes, no semicolons)
  • No new eslint warnings on modified file
  • Self-review performed
  • Non-obvious lines commented (OOXML reasoning for both fixes)
  • Verification harness confirms each fix and reproduces each bug on master
  • Only src/*.ts modified — no dist / src/bld changes

…(Issues gitbrent#1443, gitbrent#1444)

* gitbrent#1444 - emit only a single <Override> for slideMaster1.xml
  makeXmlContTypes() previously generated a slideMaster Override
  per slide ('slideMaster1.xml', 'slideMaster2.xml', ...) but only
  one slideMaster1.xml is ever written to the archive. The phantom
  references made every multi-slide deck trigger the PowerPoint
  repair dialog. Moved the Override line outside the per-slide loop.

* gitbrent#1443 - remove placeholder shapes from notesMaster
  PowerPoint stripped the 6 placeholder shapes from the notesMaster
  via the repair dialog on every open. The minimal structure (bg,
  empty spTree, clrMap, notesStyle) is what PowerPoint kept after
  repair; emitting it directly avoids the dialog. Per-slide
  notesSlide files continue to declare their own placeholders, so
  notes rendering is unaffected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant