Skip to content

Commit ec44697

Browse files
fix: paragraph alignment truthiness (#76)
* fix: explicit None check instead of falsiness * version bump
1 parent 9bc7c59 commit ec44697

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cmi-docx"
3-
version = "0.6.7"
3+
version = "0.6.8"
44
description = "Additional tooling for Python-docx."
55
readme = "README.md"
66
requires-python = ">=3.12"

src/cmi_docx/declarative/document.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -665,21 +665,21 @@ def _pack_paragraph_into_existing( # noqa: C901, PLR0912
665665
if para.heading:
666666
docx_para.style = f"Heading {para.heading}"
667667

668-
if para.alignment:
668+
if para.alignment is not None:
669669
docx_para.alignment = para.alignment
670670

671671
fmt = docx_para.paragraph_format
672-
if para.spacing_before:
672+
if para.spacing_before is not None:
673673
fmt.space_before = shared.Pt(para.spacing_before)
674-
if para.spacing_after:
674+
if para.spacing_after is not None:
675675
fmt.space_after = shared.Pt(para.spacing_after)
676-
if para.line_spacing:
676+
if para.line_spacing is not None:
677677
fmt.line_spacing = para.line_spacing
678-
if para.left_indent:
678+
if para.left_indent is not None:
679679
fmt.left_indent = shared.Pt(para.left_indent)
680-
if para.right_indent:
680+
if para.right_indent is not None:
681681
fmt.right_indent = shared.Pt(para.right_indent)
682-
if para.first_line_indent:
682+
if para.first_line_indent is not None:
683683
fmt.first_line_indent = shared.Pt(para.first_line_indent)
684684
if para.keep_together is not None:
685685
fmt.keep_together = para.keep_together

0 commit comments

Comments
 (0)