Reject heading_level and named_style_type together in validation

Add mutual exclusion guard so clients get a clear error instead of
named_style_type silently overriding heading_level.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rein Lemmens
2026-03-12 21:20:17 +01:00
parent 9285a5f97e
commit 59b3a2492c

View File

@@ -316,6 +316,12 @@ class ValidationManager:
"At least one paragraph style parameter must be provided (heading_level, alignment, line_spacing, indent_first_line, indent_start, indent_end, space_above, space_below, or named_style_type)",
)
if heading_level is not None and named_style_type is not None:
return (
False,
"heading_level and named_style_type are mutually exclusive; provide only one",
)
if named_style_type is not None:
valid_styles = [
"NORMAL_TEXT", "TITLE", "SUBTITLE",