@@ -67,80 +67,27 @@ class CT_NumPr(BaseOxmlElement):
6767 A ``<w:numPr>`` element, a container for numbering properties applied to
6868 a paragraph.
6969 """
70- def get_or_add_ilvl (self ):
71- """
72- Return the ilvl child element, newly added if not present.
73- """
74- ilvl = self .ilvl
75- if ilvl is None :
76- ilvl = self ._add_ilvl ()
77- return ilvl
78-
79- def get_or_add_numId (self ):
80- """
81- Return the numId child element, newly added if not present.
82- """
83- numId = self .numId
84- if numId is None :
85- numId = self ._add_numId ()
86- return numId
87-
88- @property
89- def ilvl (self ):
90- return self .find (qn ('w:ilvl' ))
91-
92- @ilvl .setter
93- def ilvl (self , val ):
94- """
95- Get or add a <w:ilvl> child and set its ``w:val`` attribute to *val*.
96- """
97- ilvl = self .get_or_add_ilvl ()
98- ilvl .val = val
99-
100- @classmethod
101- def new (cls ):
102- """
103- Return a new ``<w:numPr>`` element
104- """
105- return OxmlElement ('w:numPr' )
106-
107- @property
108- def numId (self ):
109- return self .find (qn ('w:numId' ))
110-
111- @numId .setter
112- def numId (self , val ):
113- """
114- Get or add a <w:numId> child and set its ``w:val`` attribute to *val*.
115- """
116- numId = self .get_or_add_numId ()
117- numId .val = val
118-
119- def _add_ilvl (self , val = 0 ):
120- """
121- Return a newly added CT_DecimalNumber element having tagname 'w:ilvl'
122- and ``val`` attribute set to *val*.
123- """
124- ilvl = CT_DecimalNumber .new ('w:ilvl' , val )
125- return self ._insert_ilvl (ilvl )
126-
127- def _add_numId (self , val = 0 ):
128- """
129- Return a newly added CT_DecimalNumber element having tagname
130- 'w:numId' and ``val`` attribute set to *val*.
131- """
132- numId = CT_DecimalNumber .new ('w:numId' , val )
133- return self ._insert_numId (numId )
134-
135- def _insert_ilvl (self , ilvl ):
136- return self .insert_element_before (
137- ilvl , 'w:numId' , 'w:numberingChange' , 'w:ins'
138- )
139-
140- def _insert_numId (self , numId ):
141- return self .insert_element_before (
142- numId , 'w:numberingChange' , 'w:ins'
143- )
70+ ilvl = ZeroOrOne ('w:ilvl' , successors = (
71+ 'w:numId' , 'w:numberingChange' , 'w:ins'
72+ ))
73+ numId = ZeroOrOne ('w:numId' , successors = ('w:numberingChange' , 'w:ins' ))
74+
75+ # @ilvl.setter
76+ # def _set_ilvl(self, val):
77+ # """
78+ # Get or add a <w:ilvl> child and set its ``w:val`` attribute to *val*.
79+ # """
80+ # ilvl = self.get_or_add_ilvl()
81+ # ilvl.val = val
82+
83+ # @numId.setter
84+ # def numId(self, val):
85+ # """
86+ # Get or add a <w:numId> child and set its ``w:val`` attribute to
87+ # *val*.
88+ # """
89+ # numId = self.get_or_add_numId()
90+ # numId.val = val
14491
14592
14693class CT_Numbering (BaseOxmlElement ):
0 commit comments