Skip to content

Improvements to Widget handling - #5127

Merged
JorjMcKie merged 1 commit into
mainfrom
update-field-logic
Sep 22, 2026
Merged

JorjMcKie merged 1 commit into
mainfrom
update-field-logic

Conversation

@JorjMcKie

Copy link
Copy Markdown
Collaborator
  • Improved / streamlined Widget insertion
  • More complete Widget deletion: We now automatically also remove parent fields when their /Kids arrays become empty.

add test script

Comment thread src/__init__.py Outdated
Comment thread src/__init__.py Outdated
Comment thread tests/test_widgets.py
* Improved / streamlined Widget insertion

* More complete Widget deletion:
  We now automatically also remove parent fields when their /Kids arrays become empty.

* Inter-field calculation is now handled during widget insertion directly and requires no separate function.

* The xref that goes into /AcroForm/CO is no longer the xref of a Widget,
  but always that of the owning (parent) Form Field.
  So the previous check that the last item of the /CO array is equal to the last inserted widget yields a wrong result.
@JorjMcKie
JorjMcKie merged commit 2e5b39e into main Sep 22, 2026
3 checks passed
@JorjMcKie
JorjMcKie deleted the update-field-logic branch September 22, 2026 14:31
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants