Skip to content

Fix DrawOrgChart resizing the target page - #228

Merged
saveenr merged 1 commit into
masterfrom
fix-draworgchart-resize
Oct 1, 2026
Merged

saveenr merged 1 commit into
masterfrom
fix-draworgchart-resize

Conversation

@saveenr

@saveenr saveenr commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #219. Client.Model.DrawOrgChart rendered the chart into a new document and then resized the page passed as its TargetPage, which does not contain the chart. That shrank the caller's page for no reason (live-verified: an 8.5 x 11 page became 1.51 x 1.51). The chart's own pages are already sized by the render, so the extra ResizeToFitContents() is removed. The TargetPage now only supplies the application, as the docs already described.

Out-VisioApplication -OrgChart goes through the same method, so it is fixed too.

Testing

  • New regression test DrawOrgChart_DrawsInANewDocumentAndLeavesTheTargetPageAlone (VTest.Models). It failed before the fix (page width 8.5 became 1.51) and passes after.
  • Debug build, local Visio: VTest.Models 81/81, VTest.Scripting 43/43, VTest.PowerShell 27/27. VTest (108 tests) is not touched by this change and was not re-run.

Also in this PR

The matching GitBook change is in saveenr/VisioAutomation_GitBook_Docs (see the companion PR); it describes this as an unreleased change after 3.1.0.

Closes #219

🤖 Generated with Claude Code

DrawOrgChart renders the chart into a new document, but then resized the page
passed as its TargetPage, which does not contain the chart. That shrank the
caller's page for no reason (live-verified: an 8.5 x 11 page became
1.51 x 1.51). The chart's own pages are already sized by the render, so the
extra resize is removed; the TargetPage now only supplies the application.

Adds a regression test that failed before the change. Updates the changelog,
test counts, the CLAUDE.md state and priorities, and the Models docs backlog
entry.

Closes #219

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@saveenr
saveenr merged commit 054d5d0 into master Oct 1, 2026
2 checks passed
@TheSevenPens
TheSevenPens deleted the fix-draworgchart-resize branch October 1, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DrawOrgChart resizes the target page but draws the chart in a new document

2 participants