From fe6fb7ea7380280c8589548fd61b121a917a356a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Nov 2024 13:56:29 +0000 Subject: Read complex field checkboxes, always unchecked --- mammoth/docx/complex_fields.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mammoth/docx/complex_fields.py') diff --git a/mammoth/docx/complex_fields.py b/mammoth/docx/complex_fields.py index 75bc05a..4112cba 100644 --- a/mammoth/docx/complex_fields.py +++ b/mammoth/docx/complex_fields.py @@ -2,6 +2,15 @@ class unknown(object): pass +class Begin: + def __init__(self, *, fld_char): + self.fld_char = fld_char + + +def begin(*, fld_char): + return Begin(fld_char=fld_char) + + class Hyperlink(object): def __init__(self, kwargs): self.kwargs = kwargs @@ -9,3 +18,12 @@ class Hyperlink(object): def hyperlink(kwargs): return Hyperlink(kwargs=kwargs) + + +class Checkbox: + def __init__(self, *, checked): + self.checked = checked + + +def checkbox(*, checked): + return Checkbox(checked=checked) -- cgit v1.2.3