fix(pptx): skip inherited content placeholders in html preview#80
Closed
kuishou68 wants to merge 1 commit intoiOfficeAI:mainfrom
Closed
fix(pptx): skip inherited content placeholders in html preview#80kuishou68 wants to merge 1 commit intoiOfficeAI:mainfrom
kuishou68 wants to merge 1 commit intoiOfficeAI:mainfrom
Conversation
3 tasks
Contributor
|
Closing in favor of #81, which addresses the same root cause (ECMA-376 §19.3.1.36 default type=obj when the attribute is absent — Open XML SDK reports HasValue==false, masking the original denylist) and additionally preserves layout placeholder chrome (fill/outline) instead of dropping the entire shape. PR #81 credits @kuishou68 as Co-Authored-By since the diagnosis and reproducer in this PR are what made the fix reachable. Thanks for the original report and screenshots — they made the bug very clear. |
goworm
added a commit
that referenced
this pull request
Apr 28, 2026
…view (#81) Layout and master content placeholders carry editor prompt boilerplate ("Click to add title", "单击此处添加正文") in their <p:txBody>. Real Office never renders that text; it shows up only in edit mode. Open XML SDK exposes the layout's <p:txBody> directly, and the previous renderer forwarded it onto the slide whenever the placeholder slipped past the type denylist. Two issues with the old denylist approach: 1. ECMA-376 §19.3.1.36 says a <p:ph> with no `type` attribute defaults to `obj`. Open XML SDK reports `Type.HasValue == false` for the absent attribute, so the entire denylist branch was skipped — and a layout body placeholder authored without an explicit type leaked its prompt text onto the slide. This is the shape behind issue #79. 2. Picture/Chart/Table/Media placeholders weren't on the denylist either, so their prompt text ("Click icon to add picture") leaked the same way. Fix: model the rule the way Apache POI does (SlideShowExtractor.java:179-183, XSLFShape.java:369-370). Layout and master placeholders never contribute text to the rendered slide — only the four metadata slots (date/footer/header/slide number) carry genuine layout-supplied content. Everything else is suppressed at the text level but still renders chrome (fill / outline / geometry), so a layout's themed placeholder background survives. The ECMA default is now applied explicitly (`Type.HasValue == false` => Object) instead of relying on a side effect of the SDK's missing HasValue. Validated with a local functional test that injects a layout placeholder with no `type` attribute and asserts the prompt text does not appear in ViewAsHtml() while the layout-supplied footer text and themed fill do. Fixes #79 Supersedes #80 Co-authored-by: pojian <lijianlin6868@gmail.com>
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.
Summary
Fixes #79
Validation
dotnet build src/officecli/officecli.csprojNote: build still reports the existing
OpenMcdfNU1902 advisory warning.